/* assets/styles.css */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700&display=swap');
/* font-display: swap is included in the URL for better performance */

:root {
    /* Backgrounds */
    --bg-main: #FFFCF9;          /* Warm Off-White/Cream */
    --bg-secondary: #F0F4F8;     /* Soft Cloud Blue */

    /* Brand Colors */
    --primary: #88B04B;          /* Sage/Pear Green - Calming headers */
    --secondary: #FFB7B2;        /* Pastel Coral/Pink - Decorations */

    /* Interactive Elements */
    --accent: #92A8D1;           /* Serenity Blue - Buttons */
    --accent-hover: #758AB6;

    /* Text */
    --text-main: #4A4A4A;        /* Dark Grey */
    --text-muted: #9CA3AF;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    background: var(--bg-main);
    color: var(--text-main);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

button:hover {
    color: var(--accent-hover);
}

.site-header {
    background: var(--primary);
    border-bottom: none;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
}

.site-header h1 {
    font-family: 'Fredoka', sans-serif;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.site-header p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.site-header a {
    color: #ffffff;
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Categories grid on home page */

h2 {
    font-family: 'Fredoka', sans-serif;
    color: var(--primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-card {
    background: #ffffff;
    border: 2px solid var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(136, 176, 75, 0.15);
    border-color: var(--secondary);
}

.category-card__name {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.category-card__slug {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Masonry layout */

.masonry {
    column-count: 4;
    column-gap: 1rem;
    margin-top: 1rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    display: inline-block;
    width: 100%;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 2px solid var(--bg-secondary);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.masonry-item img:hover {
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(255, 183, 178, 0.3);
}

/* Responsive */

@media (max-width: 1024px) {
    .masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry {
        column-count: 1;
    }
}

.category-card__icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.category-card__icon {
    max-width: 180px;
    max-height: 180px;
    display: block;
}

/* Image view page */

.image-view {
    text-align: center;
}

.image-view__actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
    border: none;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--print {
    background: #4a90d9;
    color: #fff;
}

.btn--print:hover {
    background: #3a7bc8;
}

.btn--download {
    background: #28a745;
    color: #fff;
}

.btn--download:hover {
    background: #218838;
}

.image-view__image-wrapper {
    display: flex;
    justify-content: center;
    max-height: 800px;
}

.image-view__image {
    object-fit: contain;
    max-width: 100%;
    max-height: 100vh;
    height: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Print styles */

@media print {
    .site-header,
    .image-view__actions {
        display: none !important;
    }

    .image-view__image {
        max-width: 100%;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    body {
        background: #fff;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}