/* BASE STYLES & VARIABLES */
:root {
    --sage: #7d8b77;
    --sage-dark: #626e5d;
    --sage-light: #e8ece6;
    --rose: #b8928d;
    --rose-dark: #a17c77;
    --bg-color: #faf9f6;
    --text-main: #2c3329;
    --text-muted: #646b61;
    --border-color: #e2e1dc;
    --white: #ffffff;
    --shadow-sm: 0 4px 12px rgba(44, 51, 41, 0.05);
    --shadow-md: 0 8px 24px rgba(44, 51, 41, 0.08);
    --shadow-lg: 0 12px 32px rgba(44, 51, 41, 0.12);
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .playfair {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-main);
}

.italic { font-style: italic; }

.hidden { display: none !important; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--sage);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--sage-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background-color: var(--rose);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--rose-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--sage);
    color: var(--sage);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--sage-light);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* HERO SECTION */
.hero {
    padding: 60px 0;
    background-color: var(--bg-color);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

.eyebrow {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rose);
    margin-bottom: 16px;
    font-weight: 500;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 24px;
}

.hero-content .subhead {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 540px;
}

.hero-image-wrapper {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4/3;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* PRIZE SECTION */
.prize-section {
    padding: 80px 0;
    background-color: var(--white);
}

.prize-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}

.prize-image-wrapper {
    order: 2;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 4/3;
}

.prize-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prize-content {
    order: 1;
}

.prize-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 20px;
}

.prize-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.prize-content .details {
    font-size: 0.875rem;
    color: var(--sage);
    font-weight: 500;
}

/* GALLERY SECTION */
.gallery-section {
    padding: 80px 0;
}

.gallery-header {
    text-align: center;
    margin-bottom: 48px;
}

.gallery-header h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 12px;
}

.gallery-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

.empty-icon {
    color: var(--sage);
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

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

.gallery-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-img-wrapper {
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--sage-light);
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .card-img-wrapper img {
    transform: scale(1.03);
}

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-caption {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-main);
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.card-author {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.vote-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rose);
    font-weight: 500;
    font-size: 0.875rem;
}

.vote-badge svg {
    width: 16px;
    height: 16px;
}

.vote-btn-action {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.vote-btn-action:hover {
    background: rgba(184, 146, 141, 0.1);
    color: var(--rose-dark);
}

.vote-btn-action.voted {
    color: var(--rose);
    cursor: default;
}

.vote-btn-action.voted svg {
    fill: var(--rose);
}

.load-more-wrapper {
    text-align: center;
    margin-top: 48px;
}

/* MODALS */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(44, 51, 41, 0.6);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    background: var(--white);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 32px;
    text-align: center;
}

/* FORM STYLES */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group.row {
    display: flex;
    gap: 16px;
}

.form-group.row .col {
    flex: 1;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    resize: vertical;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(125, 139, 119, 0.1);
}

.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease;
    overflow: hidden;
}

.file-upload-wrapper:hover {
    border-color: var(--sage);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.file-upload-wrapper.has-file .file-upload-placeholder {
    color: var(--sage);
}

.error-message {
    color: #d32f2f;
    font-size: 0.875rem;
    margin-bottom: 20px;
    text-align: center;
    padding: 10px;
    background: #ffebee;
    border-radius: var(--radius-md);
}

/* POST ENTRY VIEW */
.text-center { text-align: center; }

.winner-announcement {
    color: var(--sage-dark);
    font-weight: 500;
    margin-bottom: 32px;
}

.submitted-photo-wrapper {
    margin-bottom: 32px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-color);
}

.submitted-photo-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

.submitted-caption {
    padding: 16px;
    font-size: 1.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-top: none;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.share-panel {
    background: var(--bg-color);
    padding: 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.share-panel p {
    font-size: 0.875rem;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.share-input-group {
    display: flex;
    gap: 8px;
}

.share-input-group input {
    flex: 1;
    margin-bottom: 0;
}

/* LIGHTBOX */
.lightbox-dialog {
    position: relative;
    width: 100%;
    max-width: 1000px;
    background: var(--white);
    border-radius: var(--radius-lg);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 90vh;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
}

.lightbox-image-container {
    background: var(--bg-color);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.lightbox-sidebar {
    padding: 32px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lightbox-eyebrow {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.lightbox-caption {
    font-size: 2rem;
    margin-bottom: 24px;
    color: var(--text-main);
}

.btn-vote {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.btn-vote:hover {
    border-color: var(--rose);
    color: var(--rose-dark);
}

.btn-vote.voted {
    background: var(--rose);
    color: var(--white);
    border-color: var(--rose);
    cursor: default;
}

.btn-vote.voted .heart-icon {
    fill: var(--white);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--white);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    box-shadow: var(--shadow-md);
    z-index: 1002;
    transition: transform 0.2s ease;
}

.nav-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.nav-btn.prev { left: 20px; }
.nav-btn.next { right: 20px; }
.lightbox-close { top: 20px; right: 20px; z-index: 1002; background: var(--white); border-radius: 50%; width: 40px; height: 40px; box-shadow: var(--shadow-sm); }

/* RESPONSIVE */
@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .prize-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .prize-image-wrapper {
        order: 1;
    }
    
    .prize-content {
        order: 2;
    }

    .lightbox-content {
        flex-direction: row;
        height: 70vh;
    }

    .lightbox-image-container {
        flex: 2;
    }

    .lightbox-image-container img {
        max-height: 70vh;
    }

    .lightbox-sidebar {
        flex: 1;
        border-left: 1px solid var(--border-color);
        min-width: 350px;
    }
    
    .nav-btn.prev { left: -60px; }
    .nav-btn.next { right: -60px; }
}

@media (max-width: 767px) {
    .form-group.row {
        flex-direction: column;
        gap: 0;
    }
    .modal-dialog {
        padding: 24px;
    }
}

/* POWERED BY SLOT */
#wbx-powered-by-slot {
    display: flex;
    justify-content: center;
    padding: 40px 0;
    background: var(--bg-color);
}
