/* === Base Styles === */
body {
    font-family: 'Courier Prime', Courier, monospace;
    background: #f7f5f0;
    color: #2c2c2c;
    line-height: 1.6;
    margin: 0; /* Changed from padding: 20px */
    padding: 0;
    position: relative;
    min-height: 100vh;
    
    /* PREVENT LAYOUT SHIFTS */
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 69, 19, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(160, 82, 45, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* === Layout Components === */
.container {
    min-height: 100vh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    
    /* CRITICAL: Add padding here instead of body */
    padding: 20px;
    box-sizing: border-box;
    
    /* PREVENT CONTAINER SHIFTS */
    position: relative;
    min-height: calc(100vh - 40px); /* Account for padding */
}

.header {
    text-align: center;
    margin-bottom: 60px;
    border-bottom: 3px solid #2c2c2c;
    padding-bottom: 40px;
    position: relative;
    
    /* RESERVE SPACE TO PREVENT SHIFTS */
    min-height: 220px; /* Adjust based on your content */
}

.header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #d4a574;
}

.decorative-line {
    height: 2px;
    background: #2c2c2c;
    margin: 40px 0;
    position: relative;
    
    /* PREVENT SHIFTS */
    flex-shrink: 0;
}

.decorative-line::before {
    content: '◆';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #f7f5f0;
    color: #d4a574;
    padding: 0 10px;
    font-size: 16px;
}

/* === Logo Styles === */
.logo {
    width: 100px;
    height: 100px;
    border: 4px solid #2c2c2c;
    border-radius: 50%;
    margin: 0 auto 30px;
    background: #f7f5f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 0 8px rgba(44, 44, 44, 0.1);
    
    /* PREVENT LOGO SHIFTS */
    flex-shrink: 0;
}

.logo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px dashed #d4a574;
    border-radius: 50%;
    pointer-events: none;
}

.logo-img {
    width: 90%;
    height: 90%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    
    /* PREVENT IMAGE SHIFTS */
    display: block;
}

/* === Typography === */
.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #2c2c2c;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0 #d4a574;
    letter-spacing: -2px;
    margin: 0.5em 0;
    
    /* CRITICAL: PREVENT FONT LOADING SHIFTS */
    min-height: 4.2rem; /* Reserve space for the title */
    text-align: center;
    width: 100%;
    
    /* Font loading optimization */
    font-display: swap;
    font-size-adjust: 0.5; /* Maintains consistent height during font swap */
    
    /* Prevent layout movement */
    box-sizing: border-box;
}

.subtitle {
    font-size: 1.1rem;
    color: #6b6b6b;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    
    /* PREVENT SUBTITLE SHIFTS */
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subtitle::before,
.subtitle::after {
    content: '—';
    margin: 0 15px;
    color: #d4a574;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
        min-height: 3.0rem; /* Adjust for smaller screens */
    }
    
    .header {
        min-height: 180px; /* Less space needed on mobile */
        margin-bottom: 40px;
    }
    
    .container {
        padding: 15px;
        min-height: calc(100vh - 30px);
    }
}

/* === Loading States to Prevent Content Jumps === */
.gallery-section {
    /* RESERVE MINIMUM SPACE */
    min-height: 400px;
    margin: 40px 0;
}

.gallery-loading {
    min-height: 300px;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.skeleton-card {
    width: 200px;
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    flex-shrink: 0;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.form-container {
    /* RESERVE SPACE FOR FORM */
    min-height: 600px;
    margin-top: 40px;
}

/* === Additional CLS Prevention === */
img {
    /* Prevent image layout shifts */
    max-width: 100%;
    height: auto;
    display: block;
}

/* Reserve space for dynamic content */
#galleryGrid {
    min-height: 250px;
}

#dailyLimitStatus {
    min-height: 50px; /* Reserve space even when hidden */
}

/* Prevent button shifts */
.submit-btn, .see-more-btn {
    min-height: 48px;
    box-sizing: border-box;
}