/*
Theme Name: Pixabay Image Gallery
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A beautiful WordPress theme inspired by Pixabay with masonry grid layout, smooth image corners, hover zoom effects, and 4 images per row.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pixabay-gallery
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    margin-bottom: 30px;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    text-decoration: none;
}

.site-title:hover {
    color: #0073aa;
}

/* Main Content */
.site-main {
    padding: 20px 0;
}

/* Masonry Grid Container */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 0;
    padding: 0;
    grid-auto-rows: 10px; /* Small row height for masonry effect */
}

.masonry-grid.loaded {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Grid - 4 columns on desktop */
@media (max-width: 1200px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Image Item */
.masonry-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 0;
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Image Wrapper */
.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: cover;
    min-height: 200px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Hover Zoom Effect */
.masonry-item:hover img {
    transform: scale(1.1);
}

/* Image Overlay on Hover */
.masonry-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    z-index: 1;
}

.masonry-item:hover::before {
    opacity: 1;
}

/* Image Info Overlay */
.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 2;
    border-radius: 0 0 12px 12px;
}

.masonry-item:hover .image-info {
    transform: translateY(0);
}

.image-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.image-meta {
    font-size: 12px;
    opacity: 0.9;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

/* Footer */
.site-footer {
    background: #fff;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.site-footer p {
    color: #666;
    font-size: 14px;
}

/* Post Content Styles */
.post-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.post-title {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

.post-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Search and Filter Styles */
.search-filter {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: #0073aa;
}

.search-form button {
    padding: 12px 25px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: #005a87;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Image Link Styles */
.masonry-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

