/* CSS Variables - Palette based on prompt */
:root {
  --color-green: #14532d;
  --color-red: #b91c1c;
  --color-cream: #fef3c7;
  --color-brown: #78350f;
  
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
}

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

body {
  background-color: var(--color-cream);
  font-family: var(--font-sans);
  color: var(--color-brown);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Utility */
.hidden { display: none !important; }

/* Subtle Paper Grain Texture */
.texture-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Header */
.site-header {
  position: absolute;
  top: 0; left: 0; width: 100%;
  padding: 2rem;
  z-index: 20;
  text-align: center;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-cream);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  /* Dark overlay so text is readable */
  background-color: var(--color-green);
  background-blend-mode: multiply;
  opacity: 0.85;
  z-index: 1;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(20, 83, 45, 0.2), rgba(120, 53, 15, 0.9));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 5;
  color: var(--color-cream);
  max-width: 800px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.italic-accent {
  font-style: italic;
  font-weight: 600;
  color: #ffdda1;
  font-size: 0.85em;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.prize-card {
  background: rgba(254, 243, 199, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(254, 243, 199, 0.3);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  display: inline-block;
  font-size: 1.1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* CSS String Lights Particles */
.lights-container {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 4;
  pointer-events: none;
}

.light {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out alternate;
  box-shadow: 0 0 15px 3px currentColor;
}

.light.red { color: var(--color-red); background: var(--color-red); }
.light.cream { color: #ffe699; background: #ffe699; }
.light.green { color: #4ade80; background: #4ade80; }

@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.3); }
}

/* Layout Containers */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  position: relative;
  z-index: 10;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 20px 40px rgba(120, 53, 15, 0.1);
  margin-top: -80px;
  position: relative;
  z-index: 10;
  border-top: 6px solid var(--color-red);
}

.card h2 {
  font-family: var(--font-serif);
  color: var(--color-green);
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.text-center { text-align: center; }

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-brown);
}

.form-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.form-group.half {
  flex: 1;
  min-width: 250px;
}

input[type="text"], 
input[type="email"], 
input[type="number"], 
textarea, 
input[type="file"] {
  width: 100%;
  padding: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: all 0.2s;
  background: #fafaf9;
  color: var(--color-brown);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(20, 83, 45, 0.15);
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-align: left;
}

.form-checkbox input {
  margin-top: 0.35rem;
  accent-color: var(--color-red);
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.form-checkbox label {
  font-size: 0.95rem;
  color: var(--color-brown);
  line-height: 1.5;
  cursor: pointer;
}

.error-msg {
  background: #fee2e2;
  color: #b91c1c;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid #fca5a5;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-primary {
  background: var(--color-red);
  color: white;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: #991b1b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(185, 28, 28, 0.4);
}

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

.btn-secondary:hover:not(:disabled) {
  background: #166534;
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Thank you & Share Panel */
.success-msg {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.share-panel {
  background: #fafaf9;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
}

.share-panel h3 {
  font-family: var(--font-serif);
  color: var(--color-green);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.share-panel p {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.share-input-group {
  display: flex;
  gap: 0.5rem;
}

.share-input-group input {
  flex: 1;
  background: white;
}

/* Gallery Section (Voting Wall) */
.gallery-section {
  margin-top: 6rem;
  text-align: center;
}

.gallery-header h2 {
  font-family: var(--font-serif);
  color: var(--color-green);
  font-size: 3rem;
  margin-bottom: 1rem;
}

.gallery-header p {
  color: var(--color-brown);
  font-size: 1.1rem;
  margin-bottom: 3rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 650px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  /* 4x3 grid as requested */
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
}

.empty-gallery {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  background: white;
  border-radius: 12px;
  border: 2px dashed #d1d5db;
  color: var(--color-brown);
  font-size: 1.2rem;
  text-align: center;
}

.gallery-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(120, 53, 15, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 4px solid var(--color-red);
}

.gallery-details {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.gallery-caption {
  font-size: 0.95rem;
  color: var(--color-brown);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  text-align: left;
}

.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f3f4f6;
  padding-top: 1rem;
}

.vote-btn {
  background: none;
  border: 1px solid #d1d5db;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-brown);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vote-btn:hover:not(:disabled) {
  background: rgba(185, 28, 28, 0.05);
  border-color: var(--color-red);
  color: var(--color-red);
}

.vote-btn.voted {
  background: rgba(185, 28, 28, 0.1);
  color: var(--color-red);
  border-color: var(--color-red);
  cursor: default;
}

.vote-count {
  font-weight: 600;
  color: var(--color-green);
  font-size: 0.95rem;
}

.load-more-container {
  text-align: center;
  margin-top: 2rem;
}

/* Footer / Powered By Slot */
#wbx-powered-by-slot {
  display: flex;
  justify-content: center;
  padding: 2rem 0 3rem;
  max-width: 1100px;
  margin: 0 auto;
}
