/**
 * Main CSS - Minimalistic Design
 * White background + one main color
 * Mobile-first approach (2 images per row)
 */

:root {
    --main-color: #2563eb; /* Blue - can be changed */
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-color: #ffffff;
    --hover-color: #1d4ed8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

/* Header */
.header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--main-color);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 15px;
    min-height: 44px; /* Mobile touch target */
    display: flex;
    align-items: center;
}

.nav a:hover {
    background: #f3f4f6;
    color: var(--main-color);
}

/* Search */
.search-form {
    display: flex;
    gap: 8px;
}

.search-input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    min-width: 200px;
    min-height: 44px; /* Mobile touch target */
}

.search-button {
    padding: 10px 20px;
    background: var(--main-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    min-height: 44px; /* Mobile touch target */
    font-weight: 500;
}

.search-button:hover {
    background: var(--hover-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Category Grid - Homepage */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.category-item {
    text-decoration: none;
    color: var(--text-color);
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-thumbnail {
    width: 100%;
    height: 0;
    padding-bottom: 150%; /* 2:3 ratio */
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.category-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-name {
    padding: 12px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

/* Mobile: 2 images per row */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.gallery-item {
    text-decoration: none;
    color: var(--text-color);
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-thumbnail {
    width: 100%;
    height: 0;
    padding-bottom: 150%; /* 300x450 ratio (0.66) */
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.gallery-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-info {
    padding: 12px;
}

.gallery-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    gap: 12px;
}

/* Gallery Page */
.gallery-header {
    margin-bottom: 24px;
}

.gallery-title-large {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .gallery-title-large {
        font-size: 22px;
    }
}

.gallery-meta-large {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 16px;
}

.gallery-description {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.image-item {
    display: block;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.image-item:hover {
    transform: scale(1.02);
}

.image-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Image Page */
.image-viewer {
    max-width: 900px;
    margin: 0 auto 32px;
}

.image-viewer img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.image-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    gap: 12px;
}

.nav-button {
    padding: 12px 24px;
    background: var(--main-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 15px;
    min-height: 44px; /* Mobile touch target */
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover {
    background: var(--hover-color);
}

.nav-button:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* Related Galleries */
.related-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    min-height: 44px; /* Mobile touch target */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    text-decoration: none;
    font-size: 15px;
}

.pagination a {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.pagination a:hover {
    background: #f3f4f6;
    border-color: var(--main-color);
    color: var(--main-color);
}

.pagination .current {
    background: var(--main-color);
    color: white;
    border: 1px solid var(--main-color);
}

/* Ads placeholder */
.ad-container {
    margin: 24px 0;
    text-align: center;
    min-height: 100px;
    background: #f9fafb;
    border: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border-radius: 4px;
}

/* Footer */
.footer {
    background: #f9fafb;
    border-top: 1px solid var(--border-color);
    padding: 32px 16px;
    margin-top: 48px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* Utility */
.text-center {
    text-align: center;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mt-24 {
    margin-top: 24px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Error */
.error {
    text-align: center;
    padding: 40px;
    color: #dc2626;
}
