/**
 * Devotional Content Styles
 * Mobile-first responsive design for devotional reading experience.
 * Full light/dark mode support via .dark-mode (youth section theme).
 */

/* Container – theme-aware */
.devotional-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem;
  font-family: var(--font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  line-height: 1.6;
  color: var(--youth-text, var(--color-text-primary, #111827));
  background-color: var(--youth-bg, var(--color-background, #ffffff));
}

/* Article */
.devotional {
  background: var(--youth-bg-secondary, var(--color-surface, #f9fafb));
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
  border: 1px solid var(--youth-border, var(--color-border, #e5e7eb));
}

/* Header – gradient works in both modes */
.devotional-header {
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, var(--youth-primary, #6366f1) 0%, var(--youth-secondary, #8b5cf6) 100%);
  color: #fff;
}

.devotional-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.devotional-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  opacity: 0.95;
}

.devotional-topic,
.devotional-read-time {
  display: inline-flex;
  align-items: center;
}

/* Sections – theme-aware borders and spacing */
.devotional-section {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--youth-border, var(--color-border, #e5e7eb));
}

.devotional-section:last-child {
  border-bottom: none;
}

.section-title {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--youth-primary, var(--color-primary-500, #6366f1));
}

/* Hook Section */
.devotional-section-hook {
  background: var(--youth-bg-secondary, var(--color-surface, #f9fafb));
  font-size: 1.125rem;
  font-style: italic;
  color: var(--youth-text-secondary, var(--color-text-secondary, #6b7280));
}

.hook-content p {
  margin: 0;
}

/* Scripture Section */
.scripture-reference {
  margin-bottom: 1rem;
}

.scripture-reference:last-child {
  margin-bottom: 0;
}

.scripture-citation {
  margin-bottom: 0.5rem;
}

.scripture-toggle {
  background: none;
  border: none;
  color: var(--youth-primary, #6366f1);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem;
  margin: -0.5rem;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}

.scripture-toggle:hover {
  color: var(--youth-secondary, #8b5cf6);
}

.scripture-toggle::before {
  content: '▶';
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.75rem;
}

.scripture-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.scripture-text {
  padding: 1rem;
  background: var(--youth-bg-secondary, var(--color-surface, #f3f4f6));
  border-left: 4px solid var(--youth-primary, #6366f1);
  border-radius: var(--radius-md, 4px);
  margin-top: 0.5rem;
}

.scripture-text p {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--youth-text, var(--color-text-primary, #111827));
}

/* Insight Section */
.insight-content p {
  margin: 0 0 1rem 0;
  color: var(--youth-text, var(--color-text-primary, #111827));
}

.insight-content p:last-child {
  margin-bottom: 0;
}

/* Real-World Section */
.realworld-example {
  padding: 1rem;
  background: var(--color-warning-100, #fef3c7);
  border-left: 4px solid var(--youth-warning, var(--color-warning-500, #f59e0b));
  border-radius: var(--radius-md, 4px);
  margin-bottom: 1rem;
}

.realworld-example:last-child {
  margin-bottom: 0;
}

.realworld-example p {
  margin: 0;
  color: var(--youth-text, var(--color-text-primary, #111827));
}

/* Dark mode: real-world example */
.dark-mode .realworld-example {
  background: rgba(251, 191, 36, 0.15);
}

/* Reflection Section */
.reflection-question {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--youth-text, var(--color-text-primary, #1f2937));
  margin: 0 0 1rem 0;
}

.interactive-placeholder {
  margin-top: 1rem;
}

/* Challenge Section */
.challenge-prayer {
  padding: 1rem;
  background: var(--color-success-100, #f0fdf4);
  border-left: 4px solid var(--youth-success, var(--color-success-500, #10b981));
  border-radius: var(--radius-md, 4px);
  margin-bottom: 1.5rem;
}

.challenge-prayer p {
  margin: 0;
  color: var(--youth-text, #065f46);
}

.dark-mode .challenge-prayer {
  background: rgba(16, 185, 129, 0.12);
}

.dark-mode .challenge-prayer p {
  color: var(--youth-text-secondary, #a7f3d0);
}

.challenge-content h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--youth-text, var(--color-text-primary, #1f2937));
}

.actions-placeholder {
  margin-top: 1rem;
}

/* Error State – theme-aware */
.devotional-error {
  padding: 2rem;
  text-align: center;
  background: var(--color-error-50, #fef2f2);
  border: 1px solid var(--color-error-200, #fecaca);
  border-radius: var(--radius-lg, 8px);
}

.dark-mode .devotional-error {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--youth-border, #334155);
}

.error-message {
  margin: 0 0 1rem 0;
  color: var(--color-error-700, #991b1b);
  font-size: 1rem;
}

.dark-mode .error-message {
  color: var(--youth-danger, #f87171);
}

.retry-button {
  background: var(--color-error-600, #dc2626);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md, 6px);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.retry-button:hover {
  background: var(--color-error-700, #b91c1c);
}

/* Tablet and Desktop */
@media (min-width: 768px) {
  .devotional-content {
    max-width: 42rem;
    padding: 2rem 1rem;
  }

  .devotional-header {
    padding: 2rem;
  }

  .devotional-title {
    font-size: 2.25rem;
  }

  .devotional-section {
    padding: 2rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .devotional-section-hook {
    font-size: 1.25rem;
  }
}

/* Large Desktop */
@media (min-width: 1024px) {
  .devotional-content {
    max-width: 48rem;
  }
}

/* Print Styles */
@media print {
  .devotional-content {
    max-width: 100%;
    padding: 0;
  }

  .devotional-header {
    background: none;
    color: #000;
    border-bottom: 2px solid #000;
  }

  .scripture-toggle::before {
    display: none;
  }

  .scripture-text {
    display: block !important;
    background: none;
    border-left-color: #000;
  }

  .interactive-placeholder,
  .actions-placeholder {
    display: none;
  }
}

/* Accessibility */
.scripture-toggle:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.retry-button:focus {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .scripture-toggle::before {
    transition: none;
  }
}

/* ===================================
   NEO-BRUTALISM THEME OVERRIDES
   Task 8.1: Apply neo-brutalism styles to devotionals pages
   Requirements: 10.1
   =================================== */

/* Container - Bold and geometric */
[data-theme="neo-brutalism"] .devotional-content {
  font-weight: 600;
  color: #000000;
}

/* Article - Sharp corners and bold borders */
[data-theme="neo-brutalism"] .devotional {
  background: #FFFFFF;
  border-radius: 0;
  border: 4px solid #000000;
  box-shadow: 8px 8px 0 #000000;
}

/* Header - Flat teal background with bold typography */
[data-theme="neo-brutalism"] .devotional-header {
  padding: 2rem 1.5rem;
  background: #14B8A6;
  background-image: none; /* Remove gradient */
  color: #000000;
  border-bottom: 4px solid #000000;
}

[data-theme="neo-brutalism"] .devotional-title {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: #000000;
}

[data-theme="neo-brutalism"] .devotional-meta {
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 1;
  color: #000000;
}

/* Sections - Bold borders and high contrast */
[data-theme="neo-brutalism"] .devotional-section {
  padding: 2rem 1.5rem;
  border-bottom: 4px solid #000000;
}

[data-theme="neo-brutalism"] .section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #14B8A6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 3px solid #000000;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Hook Section - Bold background with sharp edges */
[data-theme="neo-brutalism"] .devotional-section-hook {
  background: #FCD34D;
  font-size: 1.25rem;
  font-style: normal;
  font-weight: 700;
  color: #000000;
  border: 4px solid #000000;
  border-radius: 0;
  padding: 2rem 1.5rem;
}

/* Scripture Section - Geometric and bold */
[data-theme="neo-brutalism"] .scripture-toggle {
  background: #14B8A6;
  border: 3px solid #000000;
  border-radius: 0;
  color: #000000;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 0.75rem 1rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 4px 4px 0 #000000;
  transition: all 150ms ease-in-out;
}

[data-theme="neo-brutalism"] .scripture-toggle:hover {
  background: #0D9488;
  box-shadow: 2px 2px 0 #000000;
  transform: translate(2px, 2px);
}

[data-theme="neo-brutalism"] .scripture-toggle:active {
  box-shadow: 1px 1px 0 #000000;
  transform: translate(3px, 3px);
}

[data-theme="neo-brutalism"] .scripture-toggle::before {
  content: '▶';
  font-size: 0.85rem;
  font-weight: 900;
}

[data-theme="neo-brutalism"] .scripture-text {
  padding: 1.5rem;
  background: #FFFFFF;
  border: 4px solid #000000;
  border-left: 8px solid #14B8A6;
  border-radius: 0;
  margin-top: 1rem;
  box-shadow: 4px 4px 0 #000000;
}

[data-theme="neo-brutalism"] .scripture-text p {
  font-size: 1.15rem;
  line-height: 1.7;
  font-weight: 600;
  color: #000000;
}

/* Insight Section - Bold typography */
[data-theme="neo-brutalism"] .insight-content p {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.7;
  color: #000000;
}

/* Real-World Section - Chunky yellow boxes */
[data-theme="neo-brutalism"] .realworld-example {
  padding: 1.5rem;
  background: #FCD34D;
  border: 4px solid #000000;
  border-left: 8px solid #F97316;
  border-radius: 0;
  box-shadow: 6px 6px 0 #000000;
  margin-bottom: 1.5rem;
}

[data-theme="neo-brutalism"] .realworld-example p {
  font-weight: 700;
  color: #000000;
}

/* Reflection Section - Bold questions */
[data-theme="neo-brutalism"] .reflection-question {
  font-size: 1.25rem;
  font-weight: 800;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-left: 6px solid #EC4899;
  padding-left: 1rem;
}

/* Challenge Section - Bold green accent */
[data-theme="neo-brutalism"] .challenge-prayer {
  padding: 1.5rem;
  background: #FFFFFF;
  border: 4px solid #000000;
  border-left: 8px solid #10B981;
  border-radius: 0;
  box-shadow: 6px 6px 0 #000000;
  margin-bottom: 2rem;
}

[data-theme="neo-brutalism"] .challenge-prayer p {
  font-weight: 700;
  color: #000000;
}

[data-theme="neo-brutalism"] .challenge-content h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Error State - Bold and clear */
[data-theme="neo-brutalism"] .devotional-error {
  padding: 2.5rem;
  background: #FEE2E2;
  border: 4px solid #000000;
  border-radius: 0;
  box-shadow: 8px 8px 0 #000000;
}

[data-theme="neo-brutalism"] .error-message {
  color: #000000;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
}

[data-theme="neo-brutalism"] .retry-button {
  background: #DC2626;
  color: #FFFFFF;
  border: 4px solid #000000;
  border-radius: 0;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 6px 6px 0 #000000;
  transition: all 150ms ease-in-out;
}

[data-theme="neo-brutalism"] .retry-button:hover {
  background: #B91C1C;
  box-shadow: 3px 3px 0 #000000;
  transform: translate(3px, 3px);
}

[data-theme="neo-brutalism"] .retry-button:active {
  box-shadow: 1px 1px 0 #000000;
  transform: translate(5px, 5px);
}

/* Tablet and Desktop - Maintain bold aesthetic */
@media (min-width: 768px) {
  [data-theme="neo-brutalism"] .devotional-title {
    font-size: 2.5rem;
  }

  [data-theme="neo-brutalism"] .section-title {
    font-size: 1.75rem;
  }

  [data-theme="neo-brutalism"] .devotional-section-hook {
    font-size: 1.4rem;
  }
}

/* Accessibility - High contrast focus indicators */
[data-theme="neo-brutalism"] .scripture-toggle:focus {
  outline: 4px solid #EC4899;
  outline-offset: 2px;
}

[data-theme="neo-brutalism"] .retry-button:focus {
  outline: 4px solid #FCD34D;
  outline-offset: 2px;
}

/* Reduced Motion - Instant state changes */
@media (prefers-reduced-motion: reduce) {
  [data-theme="neo-brutalism"] .scripture-toggle,
  [data-theme="neo-brutalism"] .retry-button {
    transition: none;
  }
  
  [data-theme="neo-brutalism"] .scripture-toggle:hover,
  [data-theme="neo-brutalism"] .retry-button:hover {
    transform: none;
  }
}

/* My notes section - journal per devotional, theme-aware */
.devotional-notes-section {
  margin-top: 2rem;
  padding: 1.5rem 1rem;
  background: var(--youth-bg-secondary, var(--color-surface, #f8fafc));
  border-radius: var(--radius-lg, 8px);
  border: 1px solid var(--youth-border, var(--color-border, #e2e8f0));
}

.devotional-notes-title {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--youth-text, var(--color-text-primary, #334155));
}

.devotional-notes-hint {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: var(--youth-text-secondary, #64748b);
}

.devotional-notes-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--youth-text, var(--color-text-primary, #334155));
  background: var(--youth-bg, var(--color-background, #fff));
  border: 1px solid var(--youth-border, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  resize: vertical;
  box-sizing: border-box;
}

.devotional-notes-textarea::placeholder {
  color: var(--youth-text-secondary, #94a3b8);
}

.devotional-notes-textarea:focus {
  outline: none;
  border-color: var(--youth-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.devotional-notes-status {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--youth-text-secondary, #64748b);
  min-height: 1.25rem;
}

.devotional-notes-status.saved {
  color: var(--youth-success, #059669);
}

/* Actions bar and navigation – theme-aware (from read-page.js) */
.devotional-reading-view .devotional-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--youth-border, var(--color-border, #e5e7eb));
}

.devotional-reading-view .devotional-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--youth-border, var(--color-border, #e5e7eb));
}

@media (max-width: 640px) {
  .devotional-reading-view .devotional-navigation {
    grid-template-columns: 1fr;
  }
}

.devotional-reading-view .nav-btn {
  color: var(--youth-primary, #6366f1);
  text-decoration: none;
  font-weight: 600;
}

.devotional-reading-view .nav-btn:hover {
  color: var(--youth-secondary, #8b5cf6);
}
