/* ========================================
   FICHIER CSS UNIFIÉ POUR LE BLOG TCF CANADA
   Utilisé par : blog.index et blog.show
   ======================================== */

/* === PROTECTION DE LA NAVIGATION === */
nav .group .absolute {
  transition: all 0.7s ease-in-out !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(5px) !important;
}

nav .group:hover .absolute {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* Éviter que d'autres scripts interfèrent avec la navigation */
nav, 
nav *, 
.navigation,
.navigation *,
header:not(.hero-section),
header:not(.hero-section) * {
  animation: none !important;
}

/* === ANIMATIONS COMMUNES === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes heroFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes heroFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
  60% {
    transform: translateY(-2px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.05);
  }
}

/* === STYLES DE BASE === */
* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

/* === HERO SECTION COMMUNE === */
.hero-section {
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 50%, #0ea5e9 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.hero-section .hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  pointer-events: none;
}

.hero-title {
  font-weight: 800;
  color: white;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: heroFadeInUp 0.8s ease-out;
}

.hero-description {
  opacity: 0.95;
  color: white;
  line-height: 1.5;
  animation: heroFadeInUp 0.8s ease-out 0.2s both;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  animation: heroFadeInUp 0.8s ease-out 0.4s both;
}

.hero-badge {
  background: rgba(255,255,255,0.1);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  min-width: 0;
  flex-shrink: 1;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.9);
  animation: heroFadeInUp 0.8s ease-out 0.2s both;
}

.hero-cta-button {
  background: linear-gradient(45deg, #0ea5e9, #0284c7);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
  animation: heroFadeInUp 0.8s ease-out 0.4s both;
}

.hero-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.6);
}

/* === CARTES D'ARTICLES === */
.article-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: white;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.article-card:hover .article-image {
  transform: scale(1.05);
}

.article-card:hover .read-more {
  transform: translateX(5px);
}

.article-image {
  transition: transform 0.4s ease;
  position: relative;
  z-index: 0;
}

.read-more {
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 20px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 25px;
  white-space: nowrap;
}

/* === OVERLAYS === */
.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%);
  z-index: 1;
  pointer-events: none;
}

.overlay-title {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  z-index: 2;
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.overlay-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: linear-gradient(45deg, #3b82f6, #1e40af);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  z-index: 3;
}

/* === SIDEBAR === */
.sidebar-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.8);
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

.sidebar-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.sidebar-title {
  color: #1e293b;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* === PAGINATION === */
.pagination-wrapper .pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination-wrapper .page-item {
  border-radius: 10px;
  overflow: hidden;
}

.pagination-wrapper .page-link {
  padding: 12px 16px;
  background: white;
  color: #3b82f6;
  border: 2px solid #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border-radius: 10px;
}

.pagination-wrapper .page-link:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.pagination-wrapper .page-item.active .page-link {
  background: linear-gradient(45deg, #3b82f6, #1e40af);
  border-color: #3b82f6;
  color: white;
}

/* === CONTENU D'ARTICLE === */
.article-text {
  color: #374151;
  line-height: 1.7;
  font-size: 1rem;
}

.article-text * {
  color: #374151;
}

.article-text h1, .article-text h2, .article-text h3, .article-text h4, .article-text h5, .article-text h6 {
  color: #1e293b;
  font-weight: 700;
  margin: 2rem 0 1rem 0;
}

.article-text h1 {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.article-text h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
  position: relative;
}

.article-text h2::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #1e40af);
}

.article-text h3 {
  font-size: 1.4rem;
  color: #3b82f6;
}

.article-text h4 {
  font-size: 1.2rem;
  color: #1e40af;
}

.article-text p {
  margin: 1.5rem 0;
  line-height: 1.7;
}

.article-text ul, .article-text ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.article-text li {
  margin: 0.5rem 0;
}

.article-text ul li::marker {
  color: #3b82f6;
}

.article-text blockquote {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-left: 4px solid #3b82f6;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  color: #1e293b;
  font-style: italic;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
}

.article-text a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.3s ease;
}

.article-text a:hover {
  border-bottom: 1px solid #3b82f6;
}

.article-text img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 2rem auto;
  display: block;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.article-text strong {
  font-weight: 700;
  color: #1e293b;
}

.article-text em {
  font-style: italic;
  color: #3b82f6;
}

.article-text code {
  background: #f1f5f9;
  color: #1e293b;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.article-text pre {
  background: #1e293b;
  color: #f1f5f9;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.article-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.article-text th, .article-text td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.article-text th {
  background: #f8fafc;
  font-weight: 700;
  color: #1e293b;
}

/* === CLASSES UTILITAIRES === */
.flex-no-overflow {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
}

.flex-shrink {
  flex-shrink: 1;
  min-width: 0;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-container {
  background: linear-gradient(180deg, #fafbff 0%, #f1f5f9 100%);
  min-height: 100vh;
}

/* === BOUTONS ET INTERACTIONS === */
button:hover, .btn:hover {
  transform: translateY(-2px);
}

button:focus, input:focus, textarea:focus, a:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

*:focus-visible {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}

/* === FORMULAIRES === */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-input {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.newsletter-button {
  width: 100%;
  background: white;
  color: #3b82f6;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: 1fr 300px !important;
    gap: 30px !important;
  }
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  .sidebar {
    margin-top: 40px;
    order: 2;
  }
  
  .main-content {
    order: 1;
  }
  
  .hero-title {
    font-size: 1.8rem !important;
  }
  
  .hero-section {
    padding: 15px 20px !important;
  }
  
  .article-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  .filters-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px !important;
  }
  
  .filter-select {
    width: 100% !important;
  }
  
  .hero-badges {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: center !important;
  }
  
  .hero-badge {
    width: 100% !important;
    max-width: 200px !important;
    text-align: center !important;
  }

  .hero-meta {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
  }
  
  .hero-meta > div {
    width: 100% !important;
    max-width: 200px !important;
    justify-content: center !important;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 1.8rem !important;
  }
  
  .hero-description {
    font-size: 1rem !important;
    margin-bottom: 20px !important;
  }
  
  .hero-section {
    padding: 15px 5px !important;
  }
  
  .main-container {
    padding: 40px 15px !important;
  }
  
  .article-card {
    margin-bottom: 20px !important;
  }
  
  .article-content-padding {
    padding: 20px !important;
  }
  
  .sidebar-card {
    padding: 20px !important;
    margin-bottom: 20px !important;
  }
  
  .overlay-title {
    font-size: 1rem !important;
    line-height: 1.2 !important;
    -webkit-line-clamp: 2 !important;
  }
  
  .overlay-badge {
    font-size: 10px !important;
    padding: 6px 10px !important;
    top: 10px !important;
    left: 10px !important;
  }

  .article-text {
    font-size: 0.95rem;
  }
  
  .article-text h1 {
    font-size: 1.8rem;
  }
  
  .article-text h2 {
    font-size: 1.5rem;
  }
  
  .article-text h3 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem !important;
    margin-bottom: 10px !important;
  }
  
  .hero-description {
    font-size: 0.95rem !important;
  }
  
  .hero-section {
    padding: 20px 10px !important;
  }
  
  .article-grid {
    gap: 15px !important;
  }
  
  .article-image-container {
    height: 200px !important;
  }
  
  .sidebar-card {
    padding: 15px !important;
  }
  
  .sidebar-title {
    font-size: 1.2rem !important;
  }
  
  .pagination-wrapper .page-link {
    padding: 10px 12px !important;
    font-size: 14px !important;
  }

  .hero-meta {
    gap: 8px !important;
  }
  
  .hero-meta > div {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
  
  .hero-cta-button {
    padding: 10px 20px !important;
    font-size: 13px !important;
  }

  .article-text {
    font-size: 0.9rem;
  }
}

/* === OPTIMISATIONS PRINT === */
@media print {
  nav, #scroll-top, .hero-section {
    display: none !important;
  }
  
  .article-text {
    font-size: 12pt !important;
    line-height: 1.4 !important;
    color: #000 !important;
  }
  
  .article-text * {
    color: #000 !important;
  }
}

/* === RÉDUCTION MOUVEMENT === */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}