/* Moments Listing Page - Shadcn-inspired Design */
/* WCAG AAA Compliant */

.moments-page {
  min-height: 100vh;
  background: hsl(240 4.8% 95.9%);
}

.moments-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

@media (max-width: 768px) {
  .moments-container {
    padding: 1rem;
  }
}

/* Page Header */
.moments-page-header {
  margin-bottom: 2rem;
}

.moments-page-title {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(240 10% 3.9%);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

.moments-page-subtitle {
  font-size: 1rem;
  color: hsl(240 5.3% 35%);
  margin: 0;
}

/* Layout Grid */

.moments-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .moments-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */

.moments-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .moments-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem 1.5rem;
  }
  .moments-sidebar > * {
    flex: 1 1 48%;
    min-width: 180px;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .moments-sidebar {
    order: 2;
  }
}

/* Cards */
.moments-card {
  background: hsl(0 0% 100%);
  border: 1px solid hsl(240 5.9% 85%);
  border-radius: 0.5rem;
  overflow: hidden;
  padding: 0.5rem 0.75rem;
  font-size: 0.92em;
}

.moments-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem 0.5rem;
  border-bottom: 1px solid hsl(240 5.9% 92%);
}

.moments-card__icon {
  font-size: 1rem;
  color: hsl(240 5.9% 40%);
}

.moments-card__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(240 10% 3.9%);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.moments-card__body {
  padding: 0.75rem 0.5rem 0.75rem 0.5rem;
}

/* Badge */
.moments-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  background: hsl(240 4.8% 95.9%);
  color: hsl(240 10% 10%);
  border: 1px solid hsl(240 5.9% 85%);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.moments-badge:hover {
  background: hsl(240 4.8% 90%);
  border-color: hsl(240 5.9% 70%);
}

.moments-badge:focus {
  outline: 3px solid hsl(221.2 83.2% 53.3%);
  outline-offset: 2px;
}

.moments-badge i {
  font-size: 0.875rem;
}

.moments-badge--active {
  background: hsl(240 5.9% 10%);
  color: hsl(0 0% 100%);
  border-color: hsl(240 5.9% 10%);
}

.moments-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Buttons */
.moments-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.moments-btn:focus {
  outline: 3px solid hsl(221.2 83.2% 53.3%);
  outline-offset: 2px;
}


.moments-btn--primary {
  background: #294557;
  color: #fff;
  border-color: #294557;
}

.moments-btn--primary:hover {
  background: #1e3340;
}

.moments-btn--secondary {
  background: hsl(0 0% 100%);
  color: hsl(240 10% 3.9%);
  border-color: hsl(240 5.9% 85%);
}

.moments-btn--secondary:hover {
  background: hsl(240 4.8% 95.9%);
  border-color: hsl(240 5.9% 70%);
}

/* Filter Form */
.moments-filter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.moments-filter-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.moments-filter-form__label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(240 10% 3.9%);
}

.moments-filter-form__label i {
  font-size: 0.875rem;
  color: hsl(240 5.9% 40%);
}

.moments-filter-form__select {
  padding: 0.625rem 0.75rem;
  border: 1px solid hsl(240 5.9% 85%);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
  background: hsl(0 0% 100%);
  color: hsl(240 10% 3.9%);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.moments-filter-form__select:focus {
  outline: 3px solid hsl(221.2 83.2% 53.3%);
  outline-offset: 2px;
  border-color: hsl(240 5.9% 10%);
}

.moments-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Active Filters */
.moments-active-filters {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(240 5.9% 92%);
}

.moments-active-filters__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(240 5.3% 45%);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
}

/* Main Content */
.moments-main {
  min-width: 0;
}

@media (max-width: 900px) {
  .moments-main {
    order: 1;
  }
}

/* Empty State */
.moments-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: hsl(0 0% 100%);
  border: 1px solid hsl(240 5.9% 85%);
  border-radius: 0.5rem;
}

.moments-empty__icon {
  font-size: 3rem;
  color: hsl(240 5.9% 70%);
  margin-bottom: 1rem;
}

.moments-empty__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(240 10% 3.9%);
  margin: 0 0 0.5rem 0;
}

.moments-empty__text {
  font-size: 0.875rem;
  color: hsl(240 5.3% 45%);
  margin: 0 0 1rem 0;
}

/* Results Count */
.moments-results {
  font-size: 0.875rem;
  color: hsl(240 5.3% 35%);
  margin-bottom: 1rem;
}

/* WCAG AAA Touch Targets */
@media (max-width: 768px) {
  .moments-badge,
  .moments-btn,
  .moments-filter-form__select {
    min-height: 44px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast */
@media (prefers-contrast: high) {
  .moments-card {
    border-width: 2px;
    border-color: hsl(240 10% 20%);
  }
  
  .moments-badge {
    border-width: 2px;
  }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link for keyboard navigation */
.moments-skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--moments-text);
  color: var(--moments-bg-card);
  border-radius: var(--moments-radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 100;
  text-decoration: none;
  transition: top 0.2s;
}
.moments-skip-link:focus {
  top: 0.5rem;
}

/* ════════════════════════════════════════════
   DARK MODE — inline to match specificity
   ════════════════════════════════════════════ */
[data-theme="dark"] .moments-page { background: #0f172a; }
[data-theme="dark"] .moments-page-title { color: #f1f5f9; }
[data-theme="dark"] .moments-page-subtitle { color: #a8b5c4; }

[data-theme="dark"] .moments-card { background: #1e293b; border-color: #607888; }
[data-theme="dark"] .moments-card__header { border-bottom-color: #334155; }
[data-theme="dark"] .moments-card__icon { color: #7cb8f7; }
[data-theme="dark"] .moments-card__title { color: #f1f5f9; }
[data-theme="dark"] .moments-card__body { color: #e2e8f0; }

[data-theme="dark"] .moments-badge { background: #1e293b; color: #e2e8f0; border-color: #607888; }
[data-theme="dark"] .moments-badge:hover { background: #334155; border-color: #7cb8f7; }
[data-theme="dark"] .moments-badge--active { background: #7cb8f7; color: #0f172a !important; border-color: #7cb8f7; }

[data-theme="dark"] .moments-btn--primary { background: #7cb8f7; color: #0f172a !important; border-color: #7cb8f7; }
[data-theme="dark"] .moments-btn--primary:hover { background: #a5d4fd; color: #0f172a !important; }
[data-theme="dark"] .moments-btn--secondary { background: #1e293b; color: #e2e8f0; border-color: #607888; }
[data-theme="dark"] .moments-btn--secondary:hover { background: #334155; border-color: #7cb8f7; }
[data-theme="dark"] .moments-btn:focus { outline-color: #7cb8f7; }

[data-theme="dark"] .moments-filter-form__label { color: #e2e8f0; }
[data-theme="dark"] .moments-filter-form__label i { color: #a8b5c4; }
[data-theme="dark"] .moments-filter-form__select { background: #0f172a; color: #e2e8f0; border-color: #607888; }
[data-theme="dark"] .moments-filter-form__select:focus { outline-color: #7cb8f7; border-color: #7cb8f7; }

[data-theme="dark"] .moments-active-filters { border-top-color: #334155; }
[data-theme="dark"] .moments-active-filters__label { color: #a8b5c4; }

[data-theme="dark"] .moments-empty { background: #1e293b; border-color: #607888; }
[data-theme="dark"] .moments-empty__icon { color: #a8b5c4; }
[data-theme="dark"] .moments-empty__title { color: #f1f5f9; }
[data-theme="dark"] .moments-empty__text { color: #a8b5c4; }

[data-theme="dark"] .moments-results { color: #a8b5c4; }

/* ── Status card — override inline styles ── */
[data-theme="dark"] .moments-card__header {
  border-bottom-color: #334155 !important;
}
/* Status message text */
[data-theme="dark"] .moments-card__body div[style*="hsl(240"] {
  color: #a8b5c4 !important;
}
/* Status badges — dark-safe variants */
[data-theme="dark"] .moments-card__header span[style*="background:#e6fbe6"],
[data-theme="dark"] .moments-card__header span[style*="background:#e6fbe6"] {
  background: rgba(34,197,94,0.15) !important;
  color: #4ade80 !important;
  border-color: rgba(34,197,94,0.3) !important;
}
[data-theme="dark"] .moments-card__header span[style*="background:#e6fbe6"] span[style*="background:#1a7f37"] {
  background: #4ade80 !important;
}
[data-theme="dark"] .moments-card__header span[style*="background:#fffbe6"] {
  background: rgba(251,191,36,0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(251,191,36,0.3) !important;
}
[data-theme="dark"] .moments-card__header span[style*="background:#fffbe6"] span[style*="background:#b88a00"] {
  background: #fbbf24 !important;
}
[data-theme="dark"] .moments-card__header span[style*="background:#fbeaea"] {
  background: rgba(239,68,68,0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(239,68,68,0.3) !important;
}
[data-theme="dark"] .moments-card__header span[style*="background:#fbeaea"] span[style*="background:#b71c1c"] {
  background: #fca5a5 !important;
}

/* ── Email subscribe — override inline color ── */
[data-theme="dark"] .moments-card__body p[style*="hsl(240"] {
  color: #a8b5c4 !important;
}

/* ── MailerLite embed dark mode ── */
[data-theme="dark"] .ml-embedded label {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .ml-embedded p,
[data-theme="dark"] .ml-embedded span:not([style*="background"]) {
  color: #a8b5c4 !important;
}
[data-theme="dark"] .ml-embedded input[type="email"],
[data-theme="dark"] .ml-embedded .form-control {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #607888 !important;
}
[data-theme="dark"] .ml-embedded input[type="email"]:focus,
[data-theme="dark"] .ml-embedded .form-control:focus {
  border-color: #7cb8f7 !important;
  box-shadow: 0 0 0 3px rgba(124,184,247,.15) !important;
}
/* MailerLite button — target the button, NOT the .primary wrapper div */
[data-theme="dark"] .ml-embedded .primary {
  background: transparent !important;
}
[data-theme="dark"] .ml-embedded .primary button,
[data-theme="dark"] .ml-embedded button[type="submit"] {
  background: #7cb8f7 !important;
  color: #0f172a !important;
  border-color: #7cb8f7 !important;
}
[data-theme="dark"] .ml-embedded .primary button:hover,
[data-theme="dark"] .ml-embedded button[type="submit"]:hover {
  background: #a5d4fd !important;
}

/* ── Checkbox — dark mode friendly ── */
[data-theme="dark"] .ml-embedded input[type="checkbox"],
[data-theme="dark"] input[type="checkbox"] {
  accent-color: #7cb8f7;
}
[data-theme="dark"] .ml-embedded .label-description,
[data-theme="dark"] .ml-embedded .label-description p {
  color: #a8b5c4 !important;
}
/* Custom checkbox appearance for dark mode */
[data-theme="dark"] .ml-embedded .label-description::before,
[data-theme="dark"] .ml-embedded input[type="checkbox"] {
  background-color: #0f172a !important;
  border-color: #607888 !important;
}
[data-theme="dark"] .ml-embedded input[type="checkbox"]:checked {
  background-color: #7cb8f7 !important;
  border-color: #7cb8f7 !important;
}
