/*
 * CCAB Gallery Standard Stylesheet
 * Unified styling for all gallery index pages
 * Organic-nature theme matching the CCAB design system
 */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

:root {
    /* Organic-nature color palette */
    --sage: #8A9A5B;
    --moss: #606C38;
    --earth: #DDA15E;
    --cream: #FEFAE0;
    --terracotta: #BC6C25;
    --dark-moss: #3d4423;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
}

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

/* Base */
body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #FEFAE0 0%, #F4F1DE 50%, #EDE8D5 100%);
    color: var(--moss);
    line-height: 1.7;
    min-height: 100vh;
}

/* Organic Background Shapes */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    opacity: 0.07;
    animation: morph 30s infinite ease-in-out;
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 500px;
    height: 500px;
    background: var(--sage);
    top: -100px;
    left: -100px;
}

body::after {
    width: 350px;
    height: 350px;
    background: var(--earth);
    bottom: -50px;
    right: -50px;
    animation-delay: -10s;
}

@keyframes morph {
    0%, 100% {
        border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 40% 60% 70% 30% / 40% 40% 60% 60%;
        transform: rotate(90deg) scale(1.05);
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
        transform: rotate(180deg) scale(1);
    }
    75% {
        border-radius: 70% 30% 50% 50% / 30% 65% 35% 70%;
        transform: rotate(270deg) scale(0.95);
    }
}

/* ===== BACK LINK ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--terracotta);
    text-decoration: none;
    font-weight: 600;
    margin: 2rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(-5px);
}

/* ===== GALLERY CONTAINER ===== */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
    position: relative;
    z-index: 1;
}

/* ===== GALLERY HEADER ===== */
.gallery-header {
    text-align: center;
    padding: 1rem 1rem 2.5rem;
    margin-bottom: 1rem;
}

.gallery-main-title {
    font-family: 'Lora', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--moss);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.gallery-header .subtitle {
    font-size: 1.15rem;
    color: var(--sage);
    margin-top: 0.25rem;
    font-style: italic;
    font-weight: 500;
}

.gallery-intro {
    font-size: 1.05rem;
    color: var(--dark-moss);
    line-height: 1.8;
    max-width: 800px;
    margin: 1.25rem auto 0;
    opacity: 0.85;
}

/* ===== GALLERY SECTIONS ===== */
.gallery-section {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem 2rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(138, 154, 91, 0.12);
    transition: all 0.3s ease;
}

.gallery-section:hover {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 32px rgba(138, 154, 91, 0.1);
}

.section-title {
    font-family: 'Lora', serif;
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 600;
    color: var(--moss);
    margin-bottom: 0.35rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--earth);
}

.section-desc {
    color: var(--dark-moss);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.75;
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* ===== GALLERY CARDS ===== */
.gallery-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--moss);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.gallery-card:hover {
    transform: translateY(-5px) scale(1.01);
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--earth);
    box-shadow: 0 15px 40px rgba(138, 154, 91, 0.18);
}

/* ===== GALLERY ICON (Number Circle) ===== */
.gallery-icon {
    min-width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--sage), var(--moss));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ===== GALLERY CONTENT ===== */
.gallery-content {
    flex: 1;
    min-width: 0;
}

.gallery-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-moss);
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

.gallery-desc {
    font-size: 0.85rem;
    color: var(--moss);
    line-height: 1.5;
    opacity: 0.8;
}

/* ===== GEN BADGES ===== */
.gen-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 10px;
    color: white;
    opacity: 0.85;
}

.gen-badge.gen-5 { background: linear-gradient(135deg, var(--sage), var(--moss)); }
.gen-badge.gen-4 { background: linear-gradient(135deg, var(--earth), var(--terracotta)); }
.gen-badge.gen-3 { background: linear-gradient(135deg, #7B8A4E, var(--sage)); }
.gen-badge.gen-2 { background: linear-gradient(135deg, var(--terracotta), #a05520); }
.gen-badge.gen-1 { background: linear-gradient(135deg, var(--moss), var(--dark-moss)); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .gallery-container {
        padding: 0 1rem 2rem;
    }

    .back-link {
        margin: 1rem;
    }

    .gallery-section {
        padding: 1.5rem 1.25rem 1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-card {
        padding: 1rem;
    }

    .gallery-header {
        padding: 0.5rem 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-main-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .gallery-intro {
        font-size: 0.95rem;
    }
}

/* ===== LEGACY CLASS SUPPORT ===== */
/* Support for older gallery pages using different class names */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.category {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(138, 154, 91, 0.12);
}

.category h2 {
    font-family: 'Lora', serif;
    color: var(--moss);
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    margin-bottom: 0.35rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--earth);
    font-weight: 600;
}

.category-description {
    color: var(--dark-moss);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.75;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.item-link {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--dark-moss);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.item-link:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--earth);
    box-shadow: 0 12px 30px rgba(138, 154, 91, 0.18);
}

.gallery-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--terracotta);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.gallery-back:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(-5px);
}

.gallery-subtitle {
    font-size: 1.15rem;
    color: var(--sage);
    margin-top: 0.25rem;
    font-style: italic;
}
