/**
 * Aubexa Theme — Custom Styles & Optimizations
 * Complément à main.css (Tailwind compilé)
 * 
 * Contient:
 * - Styles personnalisés spécifiques à Aubexa
 * - Animations avancées (GSAP ready)
 * - Optimisations WordPress
 * - Corrections de compatibilité navigateurs
 */

/* ========================================
   CUSTOM BUTTON CLASSES
   ======================================== */

.btn-primary {
  background-color: #a1a6ff;
  color: #0a0b0b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #9094e8;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ========================================
   GRADIENT UTILITIES
   ======================================== */

.gradient-primary-to-green {
  background: linear-gradient(135deg, #a1a6ff 0%, #d1ecd7 100%);
}

.gradient-primary-to-green-text {
  background: linear-gradient(135deg, #a1a6ff 0%, #d1ecd7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Top bar gradient for cards */
.gradient-top-bar {
  background: linear-gradient(to right, #a1a6ff, #d1ecd7);
}

/* Icon box gradient (replaces Tailwind arbitrary classes) */
.icon-box-gradient {
  background: linear-gradient(135deg, #a1a6ff 0%, #d1ecd7 100%);
}

/* Top icon line gradient */
.icon-top-line {
  background: linear-gradient(to right, #a1a6ff, #d1ecd7);
}

/* ========================================
   CUSTOM ANIMATIONS (GSAP Ready)
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Animation Classes */
.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

.animate-slideInLeft {
  animation: slideInLeft 0.6s ease-out;
}

.animate-slideInRight {
  animation: slideInRight 0.6s ease-out;
}

.animate-scaleIn {
  animation: scaleIn 0.4s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   HERO SECTION OPTIMIZATIONS
   ======================================== */

.hero-title-line {
  display: block;
  overflow: hidden;
}

.char-anim {
  display: inline-block;
}

.hero-txt {
  border: 1px solid #fff;
  border-radius: 20px 0;
  padding: clamp(1rem, 4vw, 2.5rem) clamp(1.5rem, 5vw, 2.5rem);
  box-shadow: 10px 10px 19px rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(15px);
}

.hero-phone {
  animation: slideInRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

/* Largeur téléphone (léger bump vs. build Next: 240/320px -> 256/340px) */
.hero-phone-wrap {
  width: 18rem; /* 288px, mobile/lg base */
}
@media (min-width: 1024px) {
  .hero-phone-wrap { width: 16rem; } /* 256px */
}
@media (min-width: 1280px) {
  .hero-phone-wrap { width: 340px; }
}

@media (max-width: 767px) {
  .hero-txt {
    border-radius: 10px;
    padding: 1rem 1.25rem;
  }
}

/* ========================================
   VERTICAL TEXT CLIP (Hero)
   ======================================== */
/* Le comportement responsive (horizontal desktop / vertical mobile) + le clip
   image proviennent du CSS de prod (main.css, build Next). On corrige seulement
   l'URL de l'image : les chemins /images/... du build n'existent pas sur WordPress. */
.vertical-text-clip {
  background-image: url("https://www.aubexa.fr/wp-content/uploads/2026/08/thai-nguyen-5Y507jwIRrY-unsplash.webp") !important;
}

/* ========================================
   STICKY CARDS SECTION (Aubexa)
   ======================================== */

.sticky-card {
  position: sticky;
  transform: translateY(-50%);
  transition: box-shadow 0.3s ease-out;
}

.sticky-card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* ========================================
   STACKING CARDS COLORÉES (Aubexa — design GitHub)
   ======================================== */

.aubexa-stack {
  width: 100%;
  position: relative;
  overflow: visible;
  background-image: url("https://www.aubexa.fr/wp-content/uploads/2026/08/thai-nguyen-5Y507jwIRrY-unsplash.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.aubexa-scard {
  position: sticky;
  border: 1px solid #fff;
  border-radius: 0.5rem;
}

.aubexa-stack-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 25vh;
  padding-bottom: 15rem;
}
@media (min-width: 768px) {
  .aubexa-stack-inner { width: 70%; }
}

.aubexa-scard--glass   { background: rgba(78, 86, 91, 0.5); backdrop-filter: blur(16px); }
.aubexa-scard--dark    { background: #4e565b; }
.aubexa-scard--gradient{ background: linear-gradient(to bottom right, #a1a6ff, #d1ecd7); }
.aubexa-scard--light   { background: #fafaf8; }

/* Titre en texte dégradé (carte "glass") */
.aubexa-title-gradient {
  background: linear-gradient(to bottom right, #a1a6ff, #d1ecd7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Couleur ardoise (cartes gradient / mise en avant) */
.aubexa-text-slate { color: #4e565b; }


/* ========================================
   BENTO CARDS GRID
   ======================================== */

.bento-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(161, 166, 255, 0.15), rgba(209, 236, 215, 0.15));
  border: 1px solid rgba(161, 166, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.bento-card:hover {
  border-color: rgba(161, 166, 255, 0.6);
  box-shadow: 0 20px 40px rgba(161, 166, 255, 0.15);
  transform: translateY(-4px);
}

.bento-card__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #a1a6ff, #d1ecd7);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bento-card:hover .bento-card__icon {
  transform: scale(1.1);
}

/* ========================================
   MODAL STYLES
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #1a1a1a;
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 42rem;
  width: 90%;
  border: 1px solid rgba(161, 166, 255, 0.3);
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content.active {
  transform: scale(1);
  opacity: 1;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, #a1a6ff, #d1ecd7);
  border-radius: 1.5rem 1.5rem 0 0;
}

/* ========================================
   ARTICLE CONTENT STYLING
   ======================================== */

.prose {
  max-width: 65ch;
  color: #0a0b0b;
  line-height: 1.8;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--font-exo2, 'Exo 2', system-ui, sans-serif);
  font-weight: 700;
  color: #0a0b0b;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose h1 { font-size: 2.25em; }
.prose h2 { font-size: 1.875em; }
.prose h3 { font-size: 1.5em; }

.prose p {
  margin-bottom: 1em;
}

.prose ul, .prose ol {
  margin: 1em 0 1em 2em;
  padding-left: 0;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose blockquote {
  border-left: 4px solid #a1a6ff;
  padding-left: 1.5em;
  margin: 1.5em 0;
  font-style: italic;
  color: #2a3a3a;
}

.prose code {
  background: #f0f0f0;
  border-radius: 0.375rem;
  padding: 0.2em 0.4em;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #d73a49;
}

.prose pre {
  background: #f6f8fa;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
}

.prose pre code {
  background: none;
  color: #0a0b0b;
  padding: 0;
}

.prose img {
  border-radius: 1rem;
  margin: 1.5em 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  height: auto;
}

.prose a {
  color: #a1a6ff;
  text-decoration: underline;
  transition: color 0.2s;
}

.prose a:hover {
  color: #c3d9e4;
}

/* ========================================
   RESPONSIVE IMAGES
   ======================================== */
/* Note : ne PAS mettre de règle `img{height:auto}` ici — non-layered, elle
   écraserait les utilitaires Tailwind (@layer) comme h-8/h-10 (logo géant).
   Le preflight Tailwind (dans main.css) gère déjà les défauts image. */

picture {
  display: block;
}

/* WebP Support */
.webp .image-fallback {
  display: none;
}

.no-webp .image-webp {
  display: none;
}

/* Lazy Loading */
img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ========================================
   WORDPRESS SPECIFIC
   ======================================== */

/* Remove WordPress alignment classes conflicts */
.aligncenter {
  display: block;
  margin: 0 auto;
}

.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1em;
}

/* Caption */
.wp-caption {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 0.5rem;
  margin: 1em 0;
  text-align: center;
}

.wp-caption img {
  display: block;
  margin: 0 auto 0.5rem;
}

.wp-caption-text {
  font-size: 0.875em;
  color: #666;
  margin: 0;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5em 0;
}

.gallery-item {
  border-radius: 0.5rem;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus Styles */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid #a1a6ff;
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #a1a6ff;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 0.5rem 0;
}

.skip-link:focus {
  top: 0;
}

/* Reduced Motion */
@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;
  }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Hardware Acceleration */
.will-change-transform {
  will-change: transform;
}

/* Contain Layout */
.contain-layout {
  contain: layout;
}

/* Contain Paint */
.contain-paint {
  contain: paint;
}

/* Contain Size */
.contain-size {
  contain: size;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  * {
    background: transparent;
    color: black;
    box-shadow: none;
    text-shadow: none;
  }

  a, a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  img {
    max-width: 100%;
  }

  @page {
    margin: 2cm;
  }

  h1, h2, h3 {
    orphans: 3;
    widows: 3;
  }

  .no-print {
    display: none;
  }
}

/* ========================================
   DARK MODE SUPPORT (Future)
   ======================================== */

@media (prefers-color-scheme: dark) {
  /* Styles seront ajoutées si dark mode est implémenté */
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #a1a6ff;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #8a8fff;
}

/* ========================================
   RESPONSIVE BREAKPOINT HELPERS
   ======================================== */

@media (max-width: 639px) {
  .show-mobile { display: block; }
  .hide-mobile { display: none; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .show-tablet { display: block; }
  .hide-tablet { display: none; }
}

@media (min-width: 1024px) {
  .show-desktop { display: block; }
  .hide-desktop { display: none; }
}
