/* public/css/pages-common.css */
/* Common Styles for All Content Pages - International Standard Readability */

/* ============================================
   TYPOGRAPHY ENHANCEMENTS
   ============================================ */

/* Improved readability for all content */
.prose {
  font-size: 1.0625rem;  /* 17px - optimal for long-form reading */
  line-height: 1.85;
  color: var(--text-secondary);
  max-width: 75ch;  /* Optimal line length */
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  color: var(--text);
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.625rem; }
.prose h3 { font-size: 1.375rem; }
.prose h4 { font-size: 1.125rem; }

.prose p {
  margin-bottom: 1.5em;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

.prose a:hover {
  color: var(--primary-dark);
}

/* ============================================
   PAGE HEADERS - UNIFIED DESIGN
   ============================================ */
.page-header-unified {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #0D9488 100%);
  padding: 2.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.page-header-unified::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-header-unified .container {
  position: relative;
  z-index: 1;
}

.page-header-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: float-gentle 4s ease-in-out infinite;
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.page-header-title {
  color: white;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.page-header-subtitle {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   CONTENT CARDS - IMPROVED READABILITY
   ============================================ */
.content-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-lighter);
}

.content-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.content-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

.content-card-title a:hover {
  color: var(--primary);
}

.content-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ============================================
   META INFORMATION - WCAG COMPLIANT
   ============================================ */
.meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;  /* Increased from 0.8125rem */
  color: var(--text-light);
  align-items: center;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.meta-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================
   BADGES - HIGH CONTRAST WCAG AA+
   ============================================ */
.badge-high-contrast {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

/* Beginner - Blue theme with high contrast */
.badge-beginner-hc {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #3B82F6;
}

/* Intermediate - Amber theme with high contrast */
.badge-intermediate-hc {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
}

/* Advanced - Orange theme with high contrast */
.badge-advanced-hc {
  background: #FFEDD5;
  color: #C2410C;
  border: 1px solid #F97316;
}

/* Expert - Purple theme with high contrast */
.badge-expert-hc {
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #A855F7;
}

/* Featured badge */
.badge-featured-hc {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

/* ============================================
   GRID LAYOUTS - RESPONSIVE
   ============================================ */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.content-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

/* Tablet breakpoint */
@media (min-width: 600px) and (max-width: 900px) {
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 599px) {
  .content-grid,
  .content-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   FILTERS - UNIFIED DESIGN
   ============================================ */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.filters-bar-justified {
  justify-content: space-between;
}

.filter-select-unified {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  min-width: 160px;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2357534E' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.filter-select-unified:hover {
  border-color: var(--border-dark);
}

.filter-select-unified:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-btn-unified {
  padding: 0.75rem 1.5rem;
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.filter-btn-unified:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

/* ============================================
   RESULTS INFO
   ============================================ */
.results-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.results-count {
  font-size: 0.9375rem;
  color: var(--text-light);
}

.results-count strong {
  color: var(--text);
  font-weight: 600;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state-unified {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.empty-state-icon-wrapper {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon-wrapper svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.empty-state-description {
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* ============================================
   PAGINATION - UNIFIED
   ============================================ */
.pagination-unified {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
}

.pagination-btn-unified {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.pagination-btn-unified:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.pagination-btn-unified.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.pagination-btn-unified svg {
  width: 16px;
  height: 16px;
}

.pagination-info {
  font-size: 0.9375rem;
  color: var(--text-light);
  font-weight: 500;
}

/* ============================================
   AUTHOR INFO
   ============================================ */
.author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar-wrapper {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.author-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */
.animate-fade-in {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .delay-1, .delay-2, .delay-3, .delay-4, .delay-5 {
    animation: none;
    opacity: 1;
  }
}

/* ============================================
   SECTION SPACING
   ============================================ */
.section-spacing {
  margin: 2.5rem 0;
}

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

/* ============================================
   CTA SECTION - UNIFIED
   ============================================ */
.cta-section-unified {
  background: var(--primary-gradient);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
}

.cta-section-unified::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cta-title {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.cta-subtitle {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.cta-buttons-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.cta-btn-primary-unified {
  background: white;
  color: var(--primary);
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-btn-primary-unified:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  color: var(--primary-dark);
}

.cta-btn-secondary-unified {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-btn-secondary-unified:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
  .page-header-unified {
    padding: 2rem 0 2.5rem;
  }

  .page-header-icon {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  .filter-select-unified {
    width: 100%;
    min-width: auto;
  }

  .results-info-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .cta-section-unified {
    padding: 2rem 1.5rem;
  }

  .cta-title {
    font-size: 1.25rem;
  }

  .cta-buttons-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .cta-btn-primary-unified,
  .cta-btn-secondary-unified {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}
