/**
 * Kéranos Média Theme Dedicated Styles & Components
 * Exact pixel-parity styling for WordPress matching the React application
 */

/* Force strict zero rounded corners on editorial media */
img, svg, picture, video, canvas, figure, .safe-image {
  border-radius: 0px !important;
}

/* Strict 16:9 aspect ratio media container & image centering */
.aspect-16-9,
.aspect-video,
.article-media-16-9 {
  aspect-ratio: 16 / 9 !important;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: block;
}

.aspect-16-9 img,
.aspect-video img,
.article-media-16-9 img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block;
}

/* Perfect Card Grid Equalization */
.article-card-equalized {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100% !important;
  border-radius: 0px !important;
}

.article-card-equalized .card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.article-card-equalized .card-title-container {
  flex-grow: 1;
}

/* Section Header Bar Alignment */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #e4e4e7;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}
.dark .section-header-row {
  border-color: #27272a;
}

/* Category section headers with vibrant RED background and bold WHITE text */
.section-header-skew {
  background-color: #F91000 !important;
  color: #ffffff !important;
  padding: 0.375rem 0.875rem !important;
  border-radius: 0px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.section-header-skew h2, 
.section-header-skew h3 {
  font-size: 0.75rem !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin: 0 !important;
  color: #ffffff !important;
  line-height: 1 !important;
}

@media (min-width: 640px) {
  .section-header-skew h2, 
  .section-header-skew h3 {
    font-size: 0.875rem !important;
  }
}

/* Typography styles for single article reading */
#article-reading-body {
  font-family: var(--font-sans);
  color: #27272a;
}
.dark #article-reading-body {
  color: #d4d4d8;
}

#article-reading-body p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-size: 1.075rem;
}

#article-reading-body h2 {
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  color: #18181b;
  border-bottom: 1px solid #e4e4e7;
  padding-bottom: 0.5rem;
}
.dark #article-reading-body h2 {
  color: #ffffff;
  border-color: #27272a;
}

#article-reading-body h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #18181b;
}
.dark #article-reading-body h3 {
  color: #ffffff;
}

#article-reading-body blockquote {
  border-left: 3px solid #F91000;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: #3f3f46;
  background-color: #f4f4f5;
}
.dark #article-reading-body blockquote {
  background-color: rgba(24, 24, 27, 0.8);
  color: #d4d4d8;
}

#article-reading-body ul, #article-reading-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

#article-reading-body li {
  margin-bottom: 0.5rem;
}

#article-reading-body img {
  border-radius: 0px !important;
  margin: 1.75rem 0;
  max-width: 100%;
  height: auto;
  border: 1px solid #e4e4e7;
}
.dark #article-reading-body img {
  border-color: #27272a;
}

/* Pagination */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 0px;
  background-color: #ffffff;
  border: 1px solid #e4e4e7;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #18181b;
  transition: all 0.2s ease;
}
.dark .nav-links .page-numbers {
  background-color: #18181b;
  border-color: #27272a;
  color: #f4f4f5;
}
.nav-links .page-numbers.current,
.nav-links .page-numbers:hover {
  background-color: #F91000;
  border-color: #F91000;
  color: #ffffff;
}

/* Comments section styling */
.comment-list .comment {
  list-style: none;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.dark .comment-list .comment {
  background: #18181b;
  border-color: #27272a;
}
.comment-author .fn {
  font-weight: 900;
  color: #F91000;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.comment-metadata a {
  font-size: 0.75rem;
  color: #71717a;
}
.comment-body p {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}
/* Reply styling */
.reply a {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #F91000;
  margin-top: 0.5rem;
}

/* Strict Logo Responsiveness & Zero-Overlap Protection */
.custom-logo-wrapper,
.custom-logo-link {
  display: inline-flex !important;
  align-items: center !important;
  max-height: 40px !important;
  flex-shrink: 0 !important;
}

.custom-logo-link img,
.custom-logo,
.custom-logo-wrapper img {
  max-height: 36px !important;
  width: auto !important;
  max-width: 170px !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

@media (min-width: 640px) {
  .custom-logo-wrapper,
  .custom-logo-link {
    max-height: 46px !important;
  }
  .custom-logo-link img,
  .custom-logo,
  .custom-logo-wrapper img {
    max-height: 42px !important;
    max-width: 220px !important;
  }
}

/* Category Badge Overlay Styles (Exact site parity: vibrant red tag top-left of image) */
.card-thumbnail-container {
  position: relative !important;
  overflow: hidden !important;
  display: block !important;
}

.category-badge-overlay {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  z-index: 20 !important;
  display: inline-flex !important;
  align-items: center !important;
  background-color: #F91000 !important;
  color: #ffffff !important;
  font-size: 8px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  padding: 2.5px 8px !important;
  line-height: 1.1 !important;
  border-radius: 0px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  pointer-events: auto !important;
  transition: background-color 0.2s ease !important;
}

@media (min-width: 640px) {
  .category-badge-overlay {
    top: 10px !important;
    left: 10px !important;
    font-size: 9px !important;
    padding: 3px 9px !important;
  }
}

.category-badge-overlay:hover {
  background-color: #b91c1c !important;
  color: #ffffff !important;
}

.category-badge-overlay-lg {
  top: 10px !important;
  left: 10px !important;
  font-size: 9px !important;
  padding: 4px 10px !important;
  letter-spacing: 0.08em !important;
}

@media (min-width: 640px) {
  .category-badge-overlay-lg {
    top: 12px !important;
    left: 12px !important;
    font-size: 10px !important;
    padding: 4px 12px !important;
  }
}

.category-badge-overlay-sm {
  top: 4px !important;
  left: 4px !important;
  font-size: 7px !important;
  padding: 2px 6px !important;
}

@media (min-width: 640px) {
  .category-badge-overlay-sm {
    top: 6px !important;
    left: 6px !important;
    font-size: 7.5px !important;
    padding: 2px 6px !important;
  }
}

/* ==========================================================================
   Kéranos Média Animations Suite (Identique au site React)
   ========================================================================== */

/* 1. Card Image Smooth Zoom on Hover */
.group .card-media-zoom,
.group img.card-img-zoom,
.card-hover-effect img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease !important;
}
.group:hover .card-media-zoom,
.group:hover img.card-img-zoom,
.card-hover-effect:hover img {
  transform: scale(1.05) !important;
}

/* 2. Reading Progress Bar */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #F91000, #ff4d4d);
  z-index: 9999;
  width: 0%;
  transition: width 0.12s ease-out;
  box-shadow: 0 0 10px rgba(249, 16, 0, 0.6);
}

/* 3. Audio Equalizer Waveform Animation */
@keyframes keranosWave {
  0%, 100% {
    height: 4px;
    opacity: 0.6;
  }
  50% {
    height: 18px;
    opacity: 1;
  }
}

.equalizer-bar {
  display: inline-block;
  width: 3px;
  background-color: currentColor;
  border-radius: 1px;
  animation: keranosWave 1.2s ease-in-out infinite;
}
.equalizer-bar:nth-child(1) { animation-delay: 0.0s; height: 6px; }
.equalizer-bar:nth-child(2) { animation-delay: 0.2s; height: 14px; }
.equalizer-bar:nth-child(3) { animation-delay: 0.4s; height: 18px; }
.equalizer-bar:nth-child(4) { animation-delay: 0.1s; height: 10px; }
.equalizer-bar:nth-child(5) { animation-delay: 0.3s; height: 8px; }

/* 4. Live Pulse Badge */
@keyframes keranosLivePulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(249, 16, 0, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(249, 16, 0, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(249, 16, 0, 0);
  }
}

.live-pulse-dot {
  animation: keranosLivePulse 2s infinite;
}

/* 5. Toast Feedback Notification */
#keranos-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #18181b;
  color: #ffffff;
  border-left: 4px solid #F91000;
  padding: 12px 18px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#keranos-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.dark #keranos-toast {
  background-color: #09090b;
  border-color: #F91000;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.8);
}

/* 6. Back to Top Floating Button */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  width: 44px;
  height: 44px;
  background-color: #F91000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0px;
  box-shadow: 0 4px 14px rgba(249, 16, 0, 0.4);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover {
  background-color: #18181b;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 7. Modal Scale-In Animation */
.modal-backdrop-animate {
  animation: keranosFadeIn 0.25s ease-out forwards;
}
.modal-box-animate {
  animation: keranosScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes keranosFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes keranosScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}


