/* Main Stylesheet for Galerie Tremblay - Sophisticated Gallery Design */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Cormorant+Garamond:wght@300;400;500;600&family=Inter:wght@300;400;500&display=swap');

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2d2d2d;
    --accent-color: #c9a961;
    --text-color: #1a1a1a;
    --text-light: #666;
    --bg-color: #ffffff;
    --bg-light: #fafafa;
    --border-color: #e5e5e5;
    --gold: #c9a961;
    --charcoal: #1a1a1a;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    font-weight: 300;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

h1 {
    font-size: 3.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Header Styles */
header {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 2rem;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--charcoal);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 3rem;
    position: relative;
}

.main-nav {
    display: flex;
    align-items: center;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--charcoal);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

nav > ul > li {
    position: relative;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
    display: block;
}

nav > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--gold);
    transition: width 0.3s ease;
}

nav > ul > li > a:hover {
    color: var(--gold);
}

nav > ul > li > a:hover::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-color);
    min-width: 180px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 1rem 0;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    border-bottom: none;
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
    color: var(--gold);
    padding-left: 2rem;
}

.language-switcher {
    display: flex;
    gap: 0.25rem;
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    border-radius: 2px;
    margin-left: 1rem;
}

.language-switcher a {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 2px;
}

.language-switcher a:hover,
.language-switcher a.active {
    background-color: var(--charcoal);
    color: var(--bg-color);
}

/* Main Content */
main {
    min-height: calc(100vh - 300px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
}

.container-wide {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* Ensure sections with container class have proper padding */
section.container {
    padding-left: 3rem;
    padding-right: 3rem;
}

/* Ensure nested content in containers doesn't break margins */
section.container > div {
    max-width: 100%;
}

/* Ensure hero section container has proper margins */
.hero .container {
    padding-left: 3rem;
    padding-right: 3rem;
}

/* Hero Section */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    font-weight: 300;
}

/* Hero with background image */
.hero[style*="background"] {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 0;
}

/* Gallery Mosaic - Beautiful varied layout */
.gallery-mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 300px;
    gap: 1.5rem;
    padding: 2rem 0;
}

.mosaic-item {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-light);
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 2px;
    min-height: 200px;
}

.mosaic-item:nth-child(1) {
    grid-row: span 2;
    grid-column: span 2;
}

.mosaic-item:nth-child(5n) {
    grid-column: span 1;
}

.mosaic-item:nth-child(7n) {
    grid-row: span 2;
}

.mosaic-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
    max-width: 100%;
}

.mosaic-item:hover img {
    transform: scale(1.08);
}

.mosaic-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mosaic-item:hover .mosaic-overlay {
    transform: translateY(0);
}

.mosaic-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.mosaic-artist {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background-color: var(--bg-light);
    cursor: pointer;
    transition: transform 0.3s ease;
    min-height: 250px;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
    max-width: 100%;
}

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.gallery-item-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Artist Grid */
.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    padding: 4rem 0;
}

.artist-card {
    text-align: center;
    transition: transform 0.3s ease;
}

.artist-card:hover {
    transform: translateY(-5px);
}

.artist-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 1.5rem;
    background-color: var(--bg-light);
    display: block;
    max-width: 100%;
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Global image loading fix */
img[src=""],
img:not([src]) {
    display: none;
}

/* Ensure images in containers are properly sized */
.container img,
.container-wide img,
main img {
    max-width: 100%;
    height: auto;
}

.artist-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--charcoal);
}

.artist-bio {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 300;
    line-height: 1.6;
}

/* Exhibition Section */
.exhibitions-section {
    padding: 2rem 0;
}

.exhibitions-section h3 {
    text-align: left;
}

.exhibition-list {
    display: grid;
    gap: 3rem;
    margin-top: 2rem;
}

.exhibition-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    align-items: start;
}

.exhibition-item:last-child {
    border-bottom: none;
}

.exhibition-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background-color: var(--bg-light);
}

.exhibition-content {
    text-align: left;
}

.exhibition-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.exhibition-date {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: left;
}

.exhibition-description {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: left;
}

.exhibition-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--charcoal);
    color: white;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 1rem;
}

.exhibition-status.upcoming {
    background-color: var(--gold);
    color: var(--charcoal);
}

.exhibition-status.past {
    background-color: var(--text-light);
}

/* Section Headers */
.section-header {
    text-align: center;
    padding: 4rem 0 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Footer Styles */
footer {
    background-color: var(--charcoal);
    color: rgba(255, 255, 255, 0.8);
    padding: 4rem 0 2rem;
    margin-top: 6rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 400;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 300;
}

.footer-section a:hover {
    color: var(--gold);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    font-weight: 300;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Language Fallback Notice */
.language-fallback-notice {
    background-color: #fff3cd;
    border-bottom: 2px solid #ffc107;
    color: #856404;
    padding: 0.75rem 2rem;
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.language-fallback-notice .close-notice {
    background: none;
    border: none;
    color: #856404;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: opacity 0.3s;
}

.language-fallback-notice .close-notice:hover {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1024px) {
    .exhibition-item {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.5rem 0;
    }
    
    .header-container {
        flex-wrap: wrap;
        padding: 0 1.5rem;
        gap: 0.5rem;
        align-items: center;
    }
    
    /* Prevent content from touching edges */
    body {
        padding-left: 0;
        padding-right: 0;
    }
    
    .logo {
        flex: 1;
        min-width: 0;
        font-size: 1.1rem;
        line-height: 1.2;
    }
    
    .mobile-menu-toggle {
        display: flex;
        order: 2;
        margin-left: 0.5rem;
        width: 24px;
        height: 24px;
    }
    
    .language-switcher {
        order: 3;
        margin-left: 0.375rem;
        flex-shrink: 0;
        padding: 0.15rem;
    }
    
    .language-switcher a {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .main-nav {
        order: 4;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        flex-basis: 100%;
    }
    
    .main-nav.active {
        max-height: 600px;
        opacity: 1;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }
    
    nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        align-items: stretch;
    }
    
    nav > ul > li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    nav > ul > li:last-child {
        border-bottom: none;
    }
    
    nav > ul > li > a {
        padding: 1rem 0;
        display: block;
        text-align: left;
        width: 100%;
        font-size: 0.95rem;
    }
    
    nav > ul > li > a::after {
        display: none;
    }
    
    .dropdown {
        position: relative;
    }
    
    .dropdown > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
        background-color: var(--bg-light);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        display: block;
    }
    
    .dropdown.active .dropdown-menu {
        max-height: 200px;
        padding: 0.5rem 0;
    }
    
    .dropdown-menu li {
        margin: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .dropdown-menu li:last-child {
        border-bottom: none;
    }
    
    .dropdown-menu a {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
        color: var(--text-color);
        display: block;
    }
    
    .dropdown-menu a::after {
        display: none;
    }
    
    .dropdown-menu a:hover {
        background-color: rgba(0, 0, 0, 0.05);
        color: var(--gold);
        padding-left: 1.75rem;
    }
    
    .container, .container-wide {
        padding: 0 1.5rem !important;
    }
    
    /* Ensure all content sections have proper spacing */
    section.container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    /* Override inline padding styles to ensure consistency */
    section.container[style*="padding"] {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    /* Better spacing for paragraphs and text content */
    main p, main div {
        max-width: 100%;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 2rem 0 !important;
    }
    
    .gallery-item {
        width: 100%;
        min-height: 300px;
        aspect-ratio: 1;
    }
    
    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .gallery-mosaic {
        grid-template-columns: 1fr !important;
        grid-auto-rows: 280px !important;
        gap: 1rem !important;
        padding: 1.5rem 0 !important;
    }
    
    /* For-artists and contact pages - keep mosaic tight with 2 columns on mobile */
    section.container .gallery-mosaic[style*="minmax(180px"] {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-rows: 180px !important;
        gap: 0.5rem !important;
    }
    
    /* Gallery and exhibitions page mini mosaics - keep compact on mobile */
    section.container .gallery-mosaic[style*="minmax(150px"] {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-rows: 150px !important;
        gap: 0.5rem !important;
    }
    
    .gallery-mosaic .mosaic-item:nth-child(1),
    .gallery-mosaic .mosaic-item:nth-child(7n),
    .gallery-mosaic .mosaic-item:nth-child(5n) {
        grid-row: span 1 !important;
        grid-column: span 1 !important;
    }
    
    .mosaic-item {
        min-height: 280px;
        width: 100%;
    }
    
    .mosaic-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .artist-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .language-fallback-notice {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .section-header {
        text-align: center;
    }
    
    .exhibition-list {
        gap: 2rem;
    }
    
    .exhibition-item {
        gap: 1.5rem;
    }
    
    .exhibition-image {
        width: 100%;
        height: auto;
        max-height: 300px;
    }
    
    .exhibition-content {
        padding: 1rem 0;
    }
    
    .artist-card {
        margin-bottom: 2rem;
    }
    
    /* Improve button and link spacing on mobile */
    a[style*="padding"] {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.85rem !important;
    }
    
    /* Improve form inputs on mobile */
    input, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Improve grid layouts for contact page */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Hero section adjustments */
    .hero {
        padding: 4rem 0 !important;
        min-height: 50vh !important;
    }
    
    .hero[style*="background"] {
        min-height: 50vh !important;
        padding: 3rem 0 !important;
    }
    
    .hero h1 {
        font-size: 2.5rem !important;
        padding: 0 1.5rem;
    }
    
    .hero p {
        font-size: 1.1rem !important;
        padding: 0 1.5rem;
    }
    
    /* Fix grid layouts with inline styles */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Fix two-column layouts */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }
    
    /* Fix exhibition items */
    .exhibition-item {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .exhibition-image {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    
    /* Better spacing for sections */
    section.container {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.4rem 0;
    }
    
    .header-container {
        padding: 0 1rem;
        gap: 0.375rem;
    }
    
    .logo {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .mobile-menu-toggle {
        width: 22px;
        height: 22px;
        margin-left: 0.375rem;
    }
    
    .language-switcher {
        margin-left: 0.25rem;
        padding: 0.1rem;
    }
    
    .language-switcher a {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .main-nav.active {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    nav > ul > li > a {
        padding: 0.875rem 0;
        font-size: 0.9rem;
    }
    
    .dropdown-menu a {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .container, .container-wide {
        padding: 0 1.25rem !important;
    }
    
    /* Ensure all content sections have proper spacing */
    section.container {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    
    /* Override inline padding styles to ensure consistency */
    section.container[style*="padding"] {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    
    /* Better spacing for text content on small screens */
    main {
        padding: 0;
    }
    
    /* Override inline padding styles to ensure proper spacing */
    section[style*="padding"] {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    
    /* Ensure divs with max-width inside containers have proper spacing */
    .container > div,
    .container-wide > div {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Fix for hero sections */
    .hero .container {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    
    /* Ensure hero section respects container margins */
    .hero {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .hero[style*="padding"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Ensure headings don't touch edges */
    h1, h2, h3, h4, h5, h6 {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Better line spacing for readability on mobile */
    p {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Fix section headers */
    .section-header {
        padding: 2rem 0 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    .section-header h2 {
        font-size: 2rem !important;
    }
    
    /* Fix artist grid */
    .artist-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        padding: 2rem 0 !important;
    }
    
    .artist-card {
        width: 100%;
    }
    
    .artist-card img {
        width: 100%;
        height: auto;
    }
    
    /* Override any max-height restrictions on mobile */
    .gallery-mosaic[style*="max-height"] {
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Fix inline style grids that break on mobile */
    div[style*="grid-template-columns: repeat"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Ensure all images are visible and properly sized */
    main img,
    .mosaic-item img,
    .gallery-item img,
    .artist-image {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix aspect ratio containers - ensure they have height */
    .mosaic-item {
        position: relative;
        min-height: 280px;
        height: 280px;
    }
    
    .gallery-item {
        position: relative;
        min-height: 300px;
        height: 300px;
    }
    
    .mosaic-item img,
    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero h1 {
        font-size: 2rem !important;
    }
    
    .hero p {
        font-size: 1rem !important;
    }
    
    .gallery-mosaic {
        gap: 0.75rem !important;
        grid-auto-rows: 250px !important;
    }
    
    /* For-artists page - keep 2 columns on small screens for tighter layout */
    section.container .gallery-mosaic[style*="minmax(180px"] {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-rows: 160px !important;
        gap: 0.5rem !important;
    }
    
    .gallery-grid {
        gap: 1rem !important;
    }
    
    .mosaic-item,
    .gallery-item {
        min-height: 250px;
    }
    
    /* Ensure all images load properly */
    img[src] {
        display: block;
        max-width: 100%;
        height: auto;
    }
    
    /* Fix for images that might not load */
    .mosaic-item:has(img[src=""]) img,
    .gallery-item:has(img[src=""]) img {
        display: none;
    }
}
