/* Gallery Styles - Mobile-first responsive design */
/* Works alongside the main andrew-and-barbara.com stylesheet */

:root {
  --accent-gold: #BFB169;
  --accent-tan: rgb(185, 163, 136);
  --text-dark: #333;
  --text-light: #666;
  --bg-light: #fafafa;
  --error-red: #d32f2f;
  --success-green: #388e3c;
  --border-radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Override external stylesheet for gallery pages */
body {
  background: white !important;
  color: var(--text-dark) !important;
}

/* Reset some styles for gallery pages specifically */
.container {
  font-family: "century-gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background: white;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Page Headers */
.page-header {
  text-align: center;
  padding: 2rem 1rem;
  border-bottom: 3px solid var(--accent-gold);
  margin-bottom: 2rem;
  background: white;
}

.page-header h1 {
  font-family: "mendl-sans-dawn", "century-gothic", sans-serif;
  font-size: 1.8rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-dark) !important;
  font-weight: normal;
}

.page-header p {
  color: var(--text-light) !important;
  margin: 0;
  font-size: 1rem;
}

/* Navigation Links */
.nav-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: white;
}

.nav-links a {
  color: var(--accent-tan) !important;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 2px solid var(--accent-tan);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.nav-links a:hover {
  background-color: var(--accent-tan) !important;
  color: white !important;
}

/* Alert Messages */
.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.alert-error {
  background-color: #ffebee;
  color: var(--error-red);
  border-left: 4px solid var(--error-red);
}

.alert-success {
  background-color: #e8f5e9;
  color: var(--success-green);
  border-left: 4px solid var(--success-green);
}

/* Upload Form */
.upload-form {
  max-width: 500px;
  margin: 0 auto;
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark) !important;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
  background: white;
  color: var(--text-dark);
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.form-group input[type="file"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed var(--accent-tan);
  border-radius: var(--border-radius);
  background-color: var(--bg-light);
  cursor: pointer;
  font-size: 0.95rem;
}

.form-group input[type="file"]::-webkit-file-upload-button {
  padding: 0.5rem 1rem;
  background-color: var(--accent-tan);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  margin-right: 1rem;
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-light) !important;
  font-size: 0.85rem;
}

/* Submit Button */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background-color: var(--accent-gold);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover {
  background-color: var(--accent-tan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn:active {
  transform: translateY(0);
}

/* Preview Page */
.preview-container {
  max-width: 600px;
  margin: 0 auto;
}

.preview-message {
  text-align: center;
  padding: 1.5rem;
  background-color: #e8f5e9;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  border: 2px solid var(--success-green);
}

.preview-message h2 {
  font-family: "mendl-sans-dusk", "century-gothic", sans-serif;
  color: var(--success-green) !important;
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: normal;
}

.preview-message p {
  color: var(--text-dark) !important;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.preview-item {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.preview-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.preview-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

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

.gallery-item a {
  display: block;
  text-decoration: none;
}

.gallery-item img {
  width: auto;
  height: auto;
  display: block;
  max-width: 100%;
  border-radius: var(--border-radius);
  border: 2px solid var(--accent-gold);
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}

.gallery-item:hover img {
  box-shadow: var(--shadow-hover);
}

.gallery-item-caption {
  padding: 0.75rem;
  text-align: center;
  background-color: var(--bg-light);
  font-size: 0.85rem;
  color: var(--text-light) !important;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light) !important;
  background: white;
}

.empty-state p {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text-light) !important;
}

/* Responsive Design - Tablet and up (640px+) */
@media (min-width: 640px) {
  .container {
    padding: 2rem;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  .page-header p {
    font-size: 1.1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
  }

  .preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
  }
}

/* Accessibility - Focus Styles */
a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Loading State */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Print Styles */
@media print {
  .nav-links,
  .upload-form,
  .btn {
    display: none;
  }

  .gallery-item {
    break-inside: avoid;
  }
}
