/* Gallery Custom Styles */
/* Inspired by 30DayChartChallenge layout with custom TidyTuesday branding */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.gallery-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-link:hover {
    text-decoration: none;
    color: inherit;
}

.gallery-image {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.week-number {
    font-size: 3rem;
    font-weight: 700;
    opacity: 0.9;
}

.gallery-content {
    padding: 1.5rem;
}

.gallery-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.week-text-blue {
    color: #667eea;
    font-size: 0.95rem;
    font-weight: 700;
    font-family:
        "Futura",
        "Avenir",
        "Century Gothic",
        "Trebuchet MS",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
}

.week-text {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-family:
        "Futura",
        "Avenir",
        "Century Gothic",
        "Trebuchet MS",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
}

.gallery-subtitle {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.language-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family:
        "Futura",
        "Avenir",
        "Century Gothic",
        "Trebuchet MS",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
}

.language-r {
    background: #1f77b4;
    color: white;
}

.language-python {
    background: #ff7f0e;
    color: white;
}

.language-unknown {
    background: #6c757d;
    color: white;
}

.tech-tag {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #e9ecef;
    font-family:
        "Futura",
        "Avenir",
        "Century Gothic",
        "Trebuchet MS",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.05) 0%,
        rgba(118, 75, 162, 0.05) 100%
    );
    border-radius: 12px;
    margin: 2rem 0;
}

.empty-state h3 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.empty-state p {
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Year section headers - 30DayChartChallenge inspired */
h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 3rem 0 1rem 0;
    border-bottom: 3px solid #667eea;
    padding: 1rem 0 0.5rem 0;
    text-align: center;
    background-color: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-family:
        "Futura",
        "Avenir",
        "Century Gothic",
        "Trebuchet MS",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
}

/* First year section */
h2:first-of-type {
    margin-top: 1rem;
}

/* Page title styling */
.quarto-title .title {
    font-family:
        "Futura",
        "Avenir",
        "Century Gothic",
        "Trebuchet MS",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    font-weight: 700;
    font-size: 3rem;
    text-align: center;
}

.quarto-title .subtitle {
    font-family:
        "Futura",
        "Avenir",
        "Century Gothic",
        "Trebuchet MS",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    opacity: 0.8;
    text-align: center;
}

/* Loading animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Staggered animation for items */
.gallery-item:nth-child(1) {
    animation-delay: 0.1s;
}
.gallery-item:nth-child(2) {
    animation-delay: 0.2s;
}
.gallery-item:nth-child(3) {
    animation-delay: 0.3s;
}
.gallery-item:nth-child(4) {
    animation-delay: 0.4s;
}
.gallery-item:nth-child(5) {
    animation-delay: 0.5s;
}
.gallery-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Focus states for accessibility */
.gallery-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 12px;
}

.gallery-link:focus .gallery-item {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* Responsive design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-image {
        height: 180px;
    }

    .gallery-content {
        padding: 1.25rem;
    }

    h2 {
        font-size: 2rem;
        margin: 2rem 0 1rem 0;
    }

    .quarto-title .title {
        font-size: 2.5rem;
    }

    .quarto-title .subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        gap: 1rem;
        margin: 1rem 0;
        grid-template-columns: 1fr;
    }

    .gallery-image {
        height: 160px;
    }

    .gallery-content {
        padding: 1rem;
    }

    .gallery-title {
        font-size: 1rem;
    }

    .gallery-subtitle {
        font-size: 0.85rem;
    }

    h2 {
        font-size: 1.8rem;
        margin: 1.5rem 0 0.75rem 0;
    }

    .quarto-title .title {
        font-size: 2rem;
    }

    .quarto-title .subtitle {
        font-size: 1rem;
    }

    .week-number {
        font-size: 2rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .gallery-item {
        background: #2c3e50;
        border-color: rgba(255, 255, 255, 0.1);
        color: #ecf0f1;
    }

    .gallery-title {
        color: #ecf0f1;
    }

    .gallery-subtitle {
        color: #bdc3c7;
    }

    .tech-tag {
        background: #34495e;
        color: #ecf0f1;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .gallery-image {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    }

    .empty-state {
        background: linear-gradient(
            135deg,
            rgba(102, 126, 234, 0.1) 0%,
            rgba(118, 75, 162, 0.1) 100%
        );
        color: #bdc3c7;
    }

    .empty-state h3 {
        color: #ecf0f1;
    }
}

/* Print styles */
@media print {
    .gallery-grid {
        display: block;
    }

    .gallery-item {
        break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .gallery-image {
        height: auto;
        min-height: 150px;
    }
}
