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

:root {
    --primary: #6366f1; /* Indigo-500 */
    --primary-dark: #4f46e5; /* Indigo-600 */
    --accent: #f59e0b; /* Amber-500 */
    --text-primary: #1f2937; /* Gray-800 */
    --text-secondary: #6b7280; /* Gray-500 */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb; /* Gray-50 */
    --bg-tertiary: #f3f4f6; /* Gray-100 */
    --border: #e5e7eb; /* Gray-200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    --font-serif: 'Georgia', 'Times New Roman', Times, serif; /* Optional serif for scripture */
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 600; /* Friendly humanist usually a bit lighter than bold */
}
h1 { font-size: 2.25rem; line-height: 1.2; letter-spacing: -0.025em;} /* Tailwind text-4xl */
h2 { font-size: 1.875rem; line-height: 1.25; letter-spacing: -0.025em;} /* Tailwind text-3xl */
h3 { font-size: 1.5rem; line-height: 1.33; letter-spacing: -0.0125em;} /* Tailwind text-2xl */
h4 { font-size: 1.125rem; line-height: 1.375; font-weight: 500;} /* Tailwind text-xl */

p { color: var(--text-secondary); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover { color: var(--primary-dark); text-decoration: underline;}

/* Layout Components */
.container {
    width: 100%;
    max-width: 1280px; /* XL breakpoint */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem; /* px-6 */
    padding-right: 1.5rem; /* px-6 */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem; /* py-2.5 px-5 */
    border-radius: var(--radius);
    font-weight: 500;
    line-height: 1.25rem; /* text-base leading-5 */
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.875rem; /* text-sm */
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary { /* More like a light/ghost button */
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background-color: var(--border); /* Darken bg-tertiary */
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem; /* text-xs */
}

.btn-icon { /* For like/comment buttons */
    display: inline-flex;
    align-items: center;
    gap: 0.375rem; /* Space between icon and count */
    background: none;
    border: none;
    padding: 0.375rem; /* Small padding for click area */
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background-color 0.2s;
}
.btn-icon:hover {
    color: var(--primary);
    background-color: var(--bg-tertiary);
}
.btn-icon svg {
    width: 18px; /* Slightly smaller icons for feed */
    height: 18px;
    stroke-width: 2; /* Ensure feather icons look right */
}
.btn-icon span { /* The count next to the icon */
    font-size: 0.8125rem; /* text-xs, slightly larger */
    font-weight: 500;
    line-height: 1; /* Align with icon */
}
/* Active state for like button (optional, if you want to toggle it) */
.btn-icon.liked svg {
    fill: var(--primary);
    stroke: var(--primary);
}
.btn-icon.liked {
    color: var(--primary);
}


/* Navigation */
nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9); /* Slightly less opaque for better blur */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    height: 4rem;
}

.nav-logo {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-logo:hover { text-decoration: none; }

.nav-logo svg.feather-shield { /* Specific styling for the new logo if needed */
    color: var(--primary); /* Make the logo icon use primary color */
}

.nav-links-container {
    display: flex; /* Default for desktop */
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s ease-in-out;
    padding: 0.5rem 0; /* Add some vertical padding for better touch targets */
}
.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
}
.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-mobile-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    margin-left: 1rem; /* Space from logo if links are hidden */
}
.nav-mobile-toggle svg {
    width: 24px;
    height: 24px;
}

/* Mobile Navigation Styles */
@media (max-width: 880px) { /* Breakpoint for hamburger menu, adjust as needed */
    .nav-links-container {
        position: absolute;
        top: 4rem; /* Below the navbar */
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        padding: 1rem 1.5rem 1.5rem; /* Padding for the dropdown area */
        flex-direction: column;
        align-items: stretch; /* Links take full width */
        display: none; /* Hidden by default */
        max-height: calc(100vh - 4rem); /* Prevent overly long menu */
        overflow-y: auto; /* Scroll if too many links */
    }

    .nav-links-container.active {
        display: flex; /* Show when active */
        animation: slideDownMobileMenu 0.3s ease-out;
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start; /* Align links to the start */
        gap: 0; /* Remove horizontal gap, manage with padding on <a> */
        width: 100%;
    }

    .nav-links a {
        padding: 0.75rem 0; /* More vertical padding for touch */
        font-size: 1rem; /* Larger font for mobile menu */
        width: 100%;
        border-bottom: 1px solid var(--bg-tertiary); /* Separator lines */
    }
    .nav-links a:last-child, 
    .nav-links .btn:last-of-type { /* If button is last, no border */
        border-bottom: none;
    }

    .nav-links .btn {
        width: 100%;
        margin-top: 1rem;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    .nav-links .btn-primary {
        margin-left: 0; /* Reset margin if any */
    }

    .nav-mobile-toggle {
        display: inline-flex; /* Show hamburger icon */
        align-items: center;
        justify-content: center;
    }
}

@keyframes slideDownMobileMenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero {
    padding: 4rem 0; /* py-16 */
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero h1 {
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5rem; /* Larger for hero */
    font-weight: 700;
}
@media (min-width: 768px) {
    .hero h1 { font-size: 3rem; } /* Even larger on desktop */
}


.hero p {
    font-size: 1.125rem; /* text-lg */
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-secondary);
}

/* Masonry Grid */
.masonry-grid {
    --masonry-gap: 1.5rem;
    columns: 2; /* Mobile first */
    column-gap: var(--masonry-gap);
    margin-top: 2rem;
}
@media (min-width: 640px) { /* sm breakpoint */
    .masonry-grid { columns: 2; }
}
@media (min-width: 1024px) { /* lg breakpoint */
    .masonry-grid { columns: 3; }
}
@media (min-width: 1280px) { /* xl breakpoint for 4 columns */
    .masonry-grid { columns: 4; }
}


.grid-item {
    break-inside: avoid;
    margin-bottom: var(--masonry-gap);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    cursor: pointer;
}

.grid-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease-in-out;
}
.grid-item:hover img {
    /* transform: scale(1.03); */ /* Subtle zoom on image itself */
}

.grid-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    color: white;
    padding: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100px; /* Ensure enough space for content */
}

.grid-item:hover .grid-item-overlay {
    opacity: 1;
    transform: translateY(0);
}
.artwork-info-overlay {
    margin-bottom: 0.75rem;
}
.artwork-info-overlay > div:first-child { /* Title */
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}
.artwork-info-overlay > div:last-child { /* Subtitle / details */
    font-size: 0.75rem;
    opacity: 0.8;
    line-height: 1.2;
}


.creator-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-grow: 1; /* Pushes button down if overlay uses flex */
    flex-direction: column;
}

.creator-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.2);
    object-fit: cover;
}

.creator-avatar-masonry {
    width: 50% !important;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.2);
    object-fit: cover;
}

.creator-details {
    flex: 1;
    line-height: 1.3;
    text-align: center;
}

.creator-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.church-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 0.25rem 0.625rem;
    border-radius: 999px; /* pill shape */
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: rgba(255,255,255,0.9); /* For overlays */
    line-height: 1.2;
}
.church-badge svg {
    width: 12px;
    height: 12px;
}

/* Church Hub */
.church-header {
    position: relative;
    height: 300px; /* Or aspect-ratio for responsiveness */
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    background-color: var(--bg-secondary); /* Fallback */
}
.church-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
}

.church-header-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 20%, rgba(0,0,0,0.5) 60%, transparent 100%);
    color: white;
}
.church-header-content h1, .church-header-content p {
    color: white;
}
.church-header-content p {
    opacity: 0.9;
    font-size: 1.125rem;
    max-width: 70ch;
}


.church-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.stat {
    text-align: left;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem; /* text-xs */
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.section-title-subtle { /* For "Church Gallery" and "Church Creators" headings */
    font-size: 1.25rem; /* text-lg */
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem; /* Consistent with other h3 mb-3 */
}

/* Instagram-like Grid for Church Gallery */
.instagram-grid {
    display: grid;
    gap: 2px; /* Minimal gap like Instagram */
    /* Responsive columns */
    grid-template-columns: repeat(3, 1fr); /* Mobile: 3 columns */
}
@media (min-width: 640px) { /* sm breakpoint: 4 columns */
    .instagram-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
    }
}
@media (min-width: 1024px) { /* lg breakpoint: 5 or 6 columns */
    .instagram-grid {
        grid-template-columns: repeat(5, 1fr); /* Or 6, depending on desired density */
        gap: 4px;
    }
}

.instagram-grid-item {
    position: relative;
    background-color: var(--bg-tertiary); /* Fallback color */
    aspect-ratio: 1 / 1; /* Square items */
    overflow: hidden; /* Clip image to square */
    cursor: pointer;
}
.instagram-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease-in-out;
}
.instagram-grid-item:hover img {
    opacity: 0.85; /* Slight dim on hover */
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem; /* Space above pagination */
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}
.pagination .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-tertiary);
    border-color: var(--border);
    color: var(--text-secondary);
}
.pagination .page-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Profile List Grid (for Church Profiles Tab) */
.profile-list-grid {
    display: grid;
    gap: 1.5rem;
    /* Responsive columns for profile cards */
    grid-template-columns: 1fr; /* Mobile: 1 column */
}
@media (min-width: 768px) { /* Tablet: 2 columns */
    .profile-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1280px) { /* Desktop: 3 columns for profiles if space allows */
    .profile-list-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* More flexible */
    }
}

.profile-list-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.profile-list-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.profile-list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.profile-list-avatar {
    width: 60px; /* Avatar size for profile list item */
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--bg-tertiary);
}
.profile-list-info h4 { /* Creator Name */
    font-size: 1.25rem; /* text-lg */
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}
.profile-media-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.media-pill {
    background-color: var(--primary-dark); /* Using primary dark for pills */
    color: white;
    font-size: 0.7rem; /* text-xs for pills */
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.profile-list-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem; /* Row and column gap for stats */
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
}
.profile-list-stats .stat-item strong {
    font-weight: 600;
    color: var(--text-primary);
}

.profile-showcase-grid { /* For individual profile's mini-gallery */
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Always 2x2 */
    gap: 2px; /* Minimal gap */
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--bg-tertiary); /* Background for gaps */
}
.profile-showcase-grid img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

/* Creator Profile */
.creator-header {
    display: flex;
    flex-direction: column; /* Mobile first */
    gap: 1.5rem;
    align-items: center; /* Mobile center */
    margin-bottom: 3rem;
    text-align: center; /* Mobile center */
}
@media (min-width: 768px) { /* md breakpoint */
    .creator-header {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 2rem;
    }
}


.creator-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.creator-bio {
    flex: 1;
}
.creator-bio .church-badge {
    color: var(--text-primary); /* Not on dark bg */
    background-color: var(--bg-tertiary);
}
.creator-bio .church-badge svg {
    color: var(--text-secondary);
}


.scripture-quote {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
    font-family: var(--font-serif); /* Optional serif */
    font-size: 1.125rem;
    line-height: 1.7;
}
.scripture-quote::before {
    content: "“";
    font-size: 1.5em;
    color: var(--primary);
    margin-right: 0.25em;
    line-height: 0;
}
.scripture-quote::after {
    content: "”";
    font-size: 1.5em;
    color: var(--primary);
    margin-left: 0.25em;
    line-height: 0;
}


/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem; /* Closer tabs */
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .tabs { gap: 1rem; }
}


.tab {
    padding: 0.75rem 1rem; /* Adjust padding */
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    margin-bottom: -1px; /* Overlap border */
    text-align: center;
}
.tab:hover {
    color: var(--text-primary);
}
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.badge-future {
    font-size: 0.65rem;
    text-transform: uppercase;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: 0.5rem;
    font-weight: 500;
}


/* Support Section on Creator Profile */
.support-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tier-card {
    background-color: var(--bg-primary); /* Lighter than secondary for contrast */
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}
.tier-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.tier-card h4 {
    font-size: 1.25rem; margin-bottom: 0.5rem;
}
.tier-card ul {
    margin: 1rem 0; padding-left: 1.25rem; font-size: 0.875rem; color: var(--text-secondary); flex-grow: 1;
}
.tier-card ul li { margin-bottom: 0.5rem; }
.tier-card .btn { margin-top: auto; } /* Push button to bottom */


.tier-price {
    font-size: 2.25rem; /* text-4xl */
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Upload Form */
.upload-form {
    max-width: 700px; /* Wider for more content */
    margin: 0 auto;
    background-color: var(--bg-primary); /* For contrast if page bg is secondary */
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input,
.form-textarea,
.form-input-inline {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: var(--bg-secondary); /* Light bg for inputs */
}
.form-input-inline {
    width: auto;
    margin-left: 0.5rem;
    max-width: 100px;
}


.form-input:focus,
.form-textarea:focus,
.form-input-inline:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); /* Focus ring */
    background-color: var(--bg-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem; /* Reduced padding */
    text-align: center;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    background-color: var(--bg-secondary);
    margin-bottom: 2rem; /* Added margin */
}

.upload-zone:hover {
    border-color: var(--primary);
    background-color: var(--bg-tertiary); /* Slightly darker on hover */
}
.upload-zone svg {
    margin-bottom: 0.5rem;
}
.support-option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}
.support-option-label input[type="checkbox"] {
    width: 1rem; height: 1rem;
}


/* Footer */
footer {
    background-color: var(--bg-secondary);
    padding: 3rem 0;
    margin-top: 5rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: stack columns */
    gap: 2.5rem; /* Increased gap between stacked columns */
    text-align: center; /* Center text on mobile */
}
@media (min-width: 640px) { /* sm breakpoint */
    .footer-content {
        grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
        text-align: left; /* Revert to left align */
    }
}
@media (min-width: 1024px) { /* lg breakpoint */
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Desktop: auto-fit columns */
    }
}
.footer-column {
    /* No specific styles needed here unless overriding alignment for some columns */
}

.footer-brand { /* The first column with brand name and copyright */
    /* On mobile, it will be center-aligned due to .footer-content text-align: center */
}
@media (min-width: 640px) {
    .footer-brand {
        /* If you want the brand specifically left-aligned on tablet+ while others might be centered */
        text-align: left; 
    }
    .footer-column { /* All columns revert to left align on tablet+ */
        text-align: left;
    }
}
.footer-content h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.75rem; /* Consistent margin */
}

.footer-links {
    list-style: none; 
    padding-left: 0;
}
.footer-links li { 
    margin-bottom: 0.5rem; 
}
.footer-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}


/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 2rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.font-medium { font-weight: 500; }
.hidden { display: none; }

/* Search Bar (Explore Page) */
.search-container {
    position: relative;
    max-width: 700px; /* Wider search */
    margin: 0 auto 2.5rem; /* More margin */
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1.25rem; /* py-3.5 px-5 */
    border: 1px solid var(--border);
    border-radius: 999px; /* pill shape */
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    background-color: var(--bg-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: var(--bg-primary);
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none; /* So it doesn't interfere with input click */
}

/* Theme Cards (Explore Page) */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.theme-card {
    position: relative;
    height: 180px; /* Slightly shorter */
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: var(--shadow-sm);
}

.theme-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.theme-card-bg {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1px; /* Thinner gap */
}

.theme-card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}
.theme-card:hover .theme-card-bg img {
    transform: scale(1.05); /* Slight zoom on images */
}


.theme-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 1rem;
    transition: background 0.3s ease-in-out;
}
.theme-card:hover .theme-card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
}

.theme-card h3 {
    margin-bottom: 0.25rem; /* Closer */
    font-size: 1.375rem;
    color: white;
}

.theme-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Church Rows (Explore Page) */
.church-row {
    margin-bottom: 2rem; /* Slightly less margin */
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); /* Softer shadow for rows */
    border: 1px solid var(--border);
}

.church-row-header {
    /* Remove direct flex behavior from header, apply to children if needed */
    cursor: pointer; /* Indicate the header area is clickable */
    padding: 1.5rem 1.5rem 0.5rem; /* Add some padding for better click area and visual separation */
    border-radius: var(--radius); /* Slightly round the clickable header area */
    transition: background-color 0.2s ease-in-out;
}
.church-row-header:hover {
    background-color: var(--bg-secondary); /* Subtle hover for the header */
}
@media (min-width: 768px) { /* md breakpoint for side-by-side header */
    .church-row {
        padding: 1.5rem;
    }
    .church-row-header {
        flex-direction: row;
        align-items: center;
        padding: 0 0 0.5rem;
        justify-content: space-between;
    }
}
.church-row-header h3 { /* Church Name */
    margin: 0 0 0.25rem 0; /* Margin bottom for spacing to location */
    font-size: 1.375rem; /* Slightly smaller than previous 1.5rem for compactness */
    color: var(--text-primary);
    line-height: 1.3;
}
.church-row-header h3:hover {
    color: var(--primary); /* Indicate link on name hover */
}
.church-row-info h3 {
    margin: 0; 
    font-size: 1.5rem; /* Slightly larger church name */
    color: var(--text-primary);
}
.church-meta {
    display: flex;
    flex-wrap: wrap; 
    gap: 0.5rem 1.25rem; /* Increased column gap */
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.church-meta span { 
    display: inline-flex; 
    align-items: center; 
}
.church-meta-icons { /* Replaces .church-meta */
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on very small screens if necessary */
    gap: 0.5rem 1.25rem; /* Gap between items, and between lines if it wraps */
    font-size: 0.8125rem; /* Slightly smaller meta text */
    color: var(--text-secondary);
    align-items: center; /* Vertically align items in the row */
    justify-content: space-between;
    margin-top: 0.5rem; /* Space between header and meta */
}
@media (min-width: 768px) { /* md breakpoint for side-by-side header */
    .church-meta-icons {
        justify-content: flex-start; /* Align items to the left on larger screens */
    }
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem; /* Space between icon and text */
}
.meta-item svg {
    width: 14px; /* Slightly smaller icons */
    height: 14px;
    stroke-width: 2; /* Keep stroke width consistent */
    color: var(--text-secondary); /* Consistent icon color */
}

.horizontal-scroll {
    display: none !important; 
}

/* Church Showcase Grid */
.church-showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Always 2 columns for the showcase itself */
    gap: 2px; /* Minimal gap between images */
    border-radius: var(--radius-sm); /* Slightly round the showcase container */
    overflow: hidden; /* Clip images to the rounded container */
    background-color: var(--bg-tertiary); /* Background for the gaps */
}

@media (min-width: 768px) { /* Tablet: 3 columns */
    .church-showcase-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) { /* Desktop: 4 columns */
    .church-showcase-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem; /* Slightly larger gap on desktop */
    }
}
@media (min-width: 1280px) { /* Larger Desktop: can also be 4, or 5 if design allows */
    .church-showcase-grid {
        grid-template-columns: repeat(4, 1fr); /* Keeping at 4 for consistency, adjust if needed */
    }
}

/* Styling for items within the church showcase grid */
.showcase-item {
    position: relative;
    background-color: var(--bg-tertiary); /* Fallback for images */
    aspect-ratio: 1 / 1; /* Make individual cells square by default */
    /* No border or explicit radius on item, parent grid handles clipping */
}

.showcase-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; /* For hover effect */
}
.showcase-item:hover img {
    transform: scale(1.05); /* Slight zoom on image hover */
    opacity: 0.85; /* Slight dim on hover to make overlay pop if we add one */
}

/* Ensure the main content area of churches view doesn't cause page scroll */
#church-listing-area {
    /* This div contains all .church-row elements. */
    /* No specific width constraints needed if .church-row is block & showcase-grid is responsive */
}

.scroll-item {
    flex: 0 0 auto; /* CRITICAL for horizontal scroll */
    width: 200px; /* Slightly smaller for more items */
    height: 260px; /* Fixed height for consistency */
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}
.scroll-item:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--shadow-md);
}

.scroll-item img {
    width: 100%;
    height: 100%; /* Fill the fixed height */
    object-fit: cover;
}
.grid-item-overlay.small-overlay {
    padding: 0.75rem;
    min-height: 60px;
    justify-content: center; /* Center content if less of it */
    text-align: center;
}
.small-overlay .creator-info { display: block; margin-bottom: 0; }
.small-overlay .creator-name { font-size: 0.875rem; }
.small-overlay .church-badge, .small-overlay .creator-avatar { display: none; } /* Hide for very small overlays */


/* Filter Sidebar (Explore Page) */
.explore-layout {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first */
    gap: 2rem;
}
@media (min-width: 968px) { /* Approx lg */
    .explore-layout {
        grid-template-columns: 260px 1fr; /* Wider sidebar */
    }
}


.filter-sidebar {
    height: fit-content; /* Only as tall as its content */
    position: sticky;
    top: 5rem; /* Below nav */
    background: var(--bg-primary); /* For mobile view where it's not part of a colored section */
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
@media (max-width: 967px) { /* When it's not sticky and full width */
    .filter-sidebar {
        position: static;
        order: -1; /* Show above content on mobile */
        margin-bottom: 2rem;
    }
}


.filter-section {
    margin-bottom: 2rem;
}
.filter-section:last-child { margin-bottom: 0; }

.filter-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary); /* Darker heading */
    font-size: 0.875rem; /* text-sm */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.filter-list {
    list-style: none;
}

.filter-list li {
    margin-bottom: 0.5rem; /* Closer items */
}

.filter-list a {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem; /* Increased vertical padding slightly */
    border-radius: var(--radius-sm);
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
}

.filter-list a:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary);
    text-decoration: none;
}

.filter-list a.active {
    background-color: var(--bg-tertiary); /* Light gray background for active */
    color: var(--primary); /* Primary color for text */
    font-weight: 600; /* Bolder text for active */
    padding-left: calc(0.75rem - 3px); /* Adjust padding to account for border */
}

.filter-count { /* Default state for count pill */
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.5rem; /* Slightly more padding */
    border-radius: var(--radius-sm);
    font-weight: 500; /* Consistent weight */
    line-height: 1.2; /* Ensure text fits well */
}

.filter-list a.active .filter-count { /* Count pill on ACTIVE filter link */
    background-color: var(--primary); /* Primary background */
    color: white; /* White text for contrast */
    /* No need to change opacity if background provides enough contrast */
}


.filter-count {
    font-size: 0.75rem; /* text-xs */
    color: var(--text-secondary); /* Same as link default */
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

/* Toggle Pills (Explore Page) */
.toggle-pills {
    display: inline-flex;
    background-color: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 999px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.toggle-pill {
    padding: 0.625rem 1.25rem; /* py-2.5 px-5 */
    border-radius: 999px;
    background-color: transparent;
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    color: var(--text-secondary);
}

.toggle-pill.active {
    background-color: white;
    color: var(--primary); /* Active pill text primary */
    box-shadow: var(--shadow-md); /* More prominent shadow for active */
}

/* Page Transitions (Basic Fade) */
.page {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}
.page.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Artwork Detail Page */
.artwork-detail-container {
    max-width: 1400px; /* Allow wider for detail page */
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.artwork-detail-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile first */
    gap: 2rem;
    margin-bottom: 3rem;
}
@media (min-width: 1024px) { /* lg */
    .artwork-detail-grid {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); /* Ratio for image and sidebar */
        gap: 3rem;
    }
}
@media (min-width: 1280px) { /* xl */
     .artwork-detail-grid {
        grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); /* Image even more prominent */
    }
}


.artwork-main-image {
    width: 100%;
    height: auto;
    max-height: 80vh; /* Prevent overly tall images */
    object-fit: contain; /* Show whole image */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-secondary); /* BG for transparent images */
}

.artwork-sidebar {
    position: sticky;
    top: 5rem; /* Below nav */
    height: calc(100vh - 6rem); /* Max height for scrollable sidebar */
    overflow-y: auto; /* Allow sidebar to scroll if content exceeds viewport */
    padding-right: 0.5rem; /* Space for scrollbar */
}
@media (max-width: 1023px) { /* Mobile/tablet, sidebar is not sticky */
    .artwork-sidebar {
        position: static;
        height: auto;
        overflow-y: visible;
        margin-top: 2rem;
        padding-right: 0;
    }
}
.artwork-sidebar > div { /* Each card in sidebar */
    margin-bottom: 1.5rem;
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.artwork-sidebar > div:last-child { margin-bottom: 0; }


.artwork-title {
    font-size: 2rem; /* text-3xl */
    font-weight: 700;
    margin-bottom: 0.5rem; /* Closer to meta */
}

.artwork-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem; /* row and col gap */
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}
.artwork-meta span { white-space: nowrap; }

.artwork-description-section p {
    font-size: 1rem; /* text-base */
    line-height: 1.7;
    color: var(--text-primary); /* Slightly darker for readability */
    max-width: 75ch; /* Optimal reading line length */
}
.artwork-description-section p + p { margin-top: 1rem; }


.purchase-section h3 { font-size: 1.25rem; }
.price-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem; /* Closer price elements */
    margin-bottom: 1rem;
}

.price-main {
    font-size: 2rem; /* text-3xl */
    font-weight: 700;
    color: var(--text-primary);
}

.purchase-options {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.purchase-option {
    display: flex;
    align-items: flex-start; /* Align radio with first line */
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: var(--bg-primary); /* Ensure contrast with parent */
}
.purchase-option:hover {
    border-color: var(--primary);
    background-color: white; /* Lighten for hover */
}
.purchase-option.selected {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05); /* Light primary tint */
    box-shadow: 0 0 0 1px var(--primary); /* Subtle ring */
}

.purchase-option input[type="radio"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem; /* Align with text better */
    width: 1rem; height: 1rem;
    accent-color: var(--primary); /* Style the radio button itself */
}

.purchase-option-details {
    flex: 1;
}
.purchase-option-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}
.purchase-option-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.artist-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.artist-card-avatar {
    width: 50px; /* Slightly smaller */
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    object-fit: cover;
}
.artist-card-name {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.125rem;
}
.artist-card .church-badge {
    font-size: 0.75rem;
    background-color: var(--bg-tertiary); /* Different from overlay version */
    color: var(--text-secondary);
}
.artist-card .church-badge svg { color: var(--text-secondary); }


.artist-card-stats {
    display: flex;
    justify-content: space-around; /* Distribute stats */
    margin-bottom: 1.5rem; /* More space before button */
    font-size: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.artist-stat { text-align: center; }
.artist-stat-value {
    font-weight: 600;
    display: block;
    font-size: 1.125rem; /* Larger stat value */
    color: var(--text-primary);
}
.artist-stat span:last-child { color: var(--text-secondary); }


.support-section { /* The artist support card in sidebar */
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    text-align: center;
}
.support-section h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}
.support-section p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}
.support-section .btn {
    border: 1px solid rgba(255,255,255,0.5);
}
.support-section .btn:hover {
    background-color: rgba(255,255,255,0.9) !important;
    color: var(--primary-dark) !important;
}


.details-section h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1rem;
}
.detail-item { font-size: 0.875rem; }
.detail-label {
    color: var(--text-secondary);
    margin-bottom: 0.125rem;
    font-size: 0.75rem; /* Smaller label */
}
.detail-value { font-weight: 500; color: var(--text-primary); }

/* Comments Section */
.comments-section {
    max-width: 800px;
    margin: 3rem auto 0; /* More top margin */
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}
.comments-section h3 { font-size: 1.5rem; }

.comment-form {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}
.comment-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 1rem;
    background-color: var(--bg-primary); /* White for input */
}
.comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.comment-form .btn { float: right; }


.comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.comment:last-child {
    border-bottom: none; margin-bottom: 0; padding-bottom: 0;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
    object-fit: cover;
}

.comment-header {
    display: flex;
    align-items: baseline; /* Align author and time better */
    gap: 0.5rem;
    margin-bottom: 0.25rem; /* Closer to text */
}
.comment-author { font-weight: 600; color: var(--text-primary); }
.comment-time { font-size: 0.75rem; color: var(--text-secondary); }
.comment-text {
    color: var(--text-secondary); /* Standard secondary for comment text */
    line-height: 1.6;
    font-size: 0.9375rem; /* Slightly smaller than main p */
}

/* Related Works */
.related-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}
.related-section h3 { font-size: 1.5rem; }

/* Home Page */
.home-header {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem; /* Ensure space before tabs */
}
.home-header h2 { /* Church name in home page */
    font-size: 1.875rem; /* text-3xl */
    margin-bottom: 0.25rem;
}
.home-subtitle { /* "Private Members Space" text */
    font-size: 1rem; /* text-base */
    color: var(--text-secondary);
    margin-bottom: 0;
}

.post-composer {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem; /* More space after composer */
    box-shadow: var(--shadow-sm);
}
.post-composer .form-textarea {
    min-height: 80px; /* Shorter for quick posts */
    background-color: var(--bg-primary); /* White background for textarea */
}
.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.composer-attachments {
    display: flex;
    gap: 0.5rem;
}
.composer-attachments .btn-secondary svg {
    margin-right: 0.375rem; /* Space between icon and text in button */
}

/* Feed Items Grid (replaces simple display:grid) */
.feed-items-grid {
    display: grid;
    gap: 2rem; /* Increased gap between feed items */
}

/* Feed Card Item (Home page) - Some existing styles might be here */
.feed-card-item {
    background: var(--bg-primary);
    padding: 1.5rem; /* Consistent padding */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); /* Slightly more prominent shadow */
    border: 1px solid var(--border); /* Subtle border */
}
.feed-card-item .creator-info .creator-avatar {
    width: 40px; 
    height: 40px;
}
.feed-item-timestamp {
    font-size: 0.75rem; /* text-xs */
    color: var(--text-secondary);
}
.feed-card-item p { /* Text within the feed item */
    font-size: 0.9375rem; /* text-sm based */
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1rem; /* Space below text before image/audio */
}
.feed-item-link { /* For "View Artwork" type links */
    font-weight: 500;
    text-decoration: underline;
}
.feed-item-image {
    width: 100%;
    max-height: 500px; /* Max height for feed images */
    object-fit: cover; /* Or contain, depending on preference */
    border-radius: var(--radius); /* Rounded corners for images */
    margin-bottom: 1rem;
    cursor: pointer;
    background-color: var(--bg-tertiary); /* Placeholder bg */
}

/* Feed Item Actions (Like, Comment, Support buttons) */
.feed-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem; /* Space above actions */
    padding-top: 1rem; /* Space and line for separation */
    border-top: 1px solid var(--bg-tertiary); /* Subtle separator */
}
.feed-item-engagement {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between like and comment */
}


/* Responsive Adjustments for Smaller Screens */
@media (max-width: 768px) { /* md */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    .hero p { font-size: 1rem; }
    
    .nav-links {
        gap: 0.5rem; /* Nav links closer on mobile */
    }
    .nav-links a { font-size: 0.8rem; } /* Smaller nav text */
    .nav-links .btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
    .nav-logo { font-size: 1rem; }
    .nav-logo svg { width: 20px; height: 20px; }


    .masonry-grid { --masonry-gap: 1rem; }
    .grid-item { margin-bottom: 1rem; }

    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Smaller related items */
        gap: 1rem;
    }
    .upload-form { padding: 1.5rem; }
    .search-container { max-width: 100%; }

    .artwork-title { font-size: 1.5rem; }
    .comments-section, .related-section { margin-top: 2rem; padding-top: 2rem; }
}
@media (max-width: 480px) { /* Extra small devices */
    .btn { padding: 0.5rem 1rem; font-size: 0.875rem; }
    .tabs { gap: 0.25rem; }
    .tab { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
    .horizontal-scroll { gap: 0.75rem; }
    .scroll-item { width: 160px; height: 210px; }
    .theme-grid { grid-template-columns: 1fr; } /* Single column themes */
    .church-row-info h3 { font-size: 1.25rem; }
    .church-meta { justify-content: center; }
}


/* Inline Audio Player Styles */
.audio-player-inline {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    width: 100%; /* Ensure it tries to take full width of its parent */
    overflow: hidden; /* Prevent children from breaking out if mis-sized */
}

.audio-play-pause-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0; /* Button should not shrink */
}
.audio-play-pause-btn:hover {
    background-color: var(--primary-dark);
}
.audio-play-pause-btn svg {
    width: 20px;
    height: 20px;
}

.audio-info {
    flex: 1 1 0; /* shorthand: flex-grow: 1, flex-shrink: 1, flex-basis: 0% */
                 /* This allows it to grow to fill space and shrink if needed, starting from a zero basis. */
    min-width: 0; /* Crucial for allowing text truncation with overflow:hidden */
    overflow: hidden; /* Added to the container of title/artist */
}
.audio-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block; /* Ensure it takes block characteristics for overflow */
}
.audio-artist {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block; /* Ensure it takes block characteristics for overflow */
}

.audio-waveform-mock {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 30px;
    /* flex: 0 1 100px; /* No grow, can shrink, preferred basis 100px - let's try auto width first */
    flex-shrink: 0; /* Keep its width if possible, but if parent is too small this might be an issue */
    width: 100px; /* Explicit width for the waveform area */
    overflow: hidden;
}
.audio-waveform-mock span {
    background-color: var(--primary-dark);
    opacity: 0.4;
    width: 3px;
    border-radius: 1px;
    display: inline-block; /* Correct for applying inline height */
    /* Heights are set inline for variation */
}

.audio-duration {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0; /* Duration text should not shrink */
    margin-left: 0.5rem; /* Or rely on parent gap */
    white-space: nowrap; /* Prevent wrapping */
}


/* Instagram-like Grid for Home Page Gallery & Church Page Gallery (if different) */
.instagram-grid {
    display: grid;
    gap: 2px; /* Minimal gap for tight grid */
    grid-template-columns: repeat(3, 1fr); /* Mobile: 3 columns */
}
@media (min-width: 500px) { /* Slightly larger mobile / small tablet */
    .instagram-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
    }
}
@media (min-width: 768px) { /* Tablet: 5 columns */
    .instagram-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
}
@media (min-width: 1024px) { /* Desktop: 6 columns */
    .instagram-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }
}

.instagram-grid-item {
    position: relative;
    background-color: var(--bg-tertiary); /* Fallback color */
    aspect-ratio: 1 / 1; /* Square items */
    overflow: hidden;
    cursor: pointer;
}
.instagram-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out, opacity 0.2s ease-in-out; /* Added transform */
}
.instagram-grid-item:hover img {
    opacity: 0.8;
    transform: scale(1.05); /* Slight zoom on hover */
}

/* Pagination Styles (already provided, ensure it's suitable) */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}
/* ... (other pagination styles remain) ... */

/* Profile List Grid (for Home Page Profiles Tab) */
.profile-list-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr; /* Mobile: 1 column */
}
@media (min-width: 640px) { /* sm breakpoint: can fit 2 if content is compact */
     .profile-list-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}
@media (min-width: 1024px) { /* lg breakpoint */
    .profile-list-grid {
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); /* Allow slightly wider cards */
    }
}

.profile-list-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem; /* Slightly reduced padding */
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
    display: flex; /* Use flex for internal layout */
    flex-direction: column; /* Stack content vertically */
}
.profile-list-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.profile-list-header {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Slightly reduced gap */
    margin-bottom: 0.75rem;
}
.profile-list-avatar {
    width: 48px; /* Slightly smaller avatar for list item */
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
}
.profile-list-info {
    flex-grow: 1; /* Allow info to take remaining space */
    min-width: 0; /* For text overflow */
}
.profile-list-info h4 { 
    font-size: 1.125rem; /* text-base or lg */
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-weight: 600; /* Make name slightly bolder */
    /* Text overflow for long names */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-list-info h4:hover {
    color: var(--primary);
}
.profile-media-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.media-pill {
    background-color: var(--bg-tertiary); 
    color: var(--text-secondary); /* Softer color for pills */
    font-size: 0.6875rem; /* Slightly smaller */
    padding: 0.125rem 0.5rem; /* Adjust padding */
    border-radius: var(--radius-sm); /* Less rounded */
    font-weight: 500;
    /* text-transform: uppercase; Removed for cleaner look */
}

.profile-list-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem; /* Row and column gap */
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-top: 0.75rem; /* Space above stats */
    /* border-bottom: 1px solid var(--bg-tertiary); Removed border for cleaner card */
}
.profile-list-stats .stat-item strong {
    font-weight: 600;
    color: var(--text-primary);
}

.profile-showcase-grid { /* Mini showcase grid */
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Always 2x2 */
    gap: 2px; 
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--bg-tertiary);
    margin-top: auto; /* Push to bottom if card has extra space */
}
.profile-showcase-grid img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}