/* Tous les champs du formulaire demande_animation en blanc */
.demande-form input,
.demande-form select,
.demande-form textarea {
  background: #fff !important;
  color: #222 !important;
}
/* thème */
:root{
  --bg:#0f0f12;
  --panel:#162447;
  --muted:#8b8b94;
  --text:#f5f6f8;
  --primary:#dc2626;
  --primary-hover:#b91c1c;
  --danger:#dc2626;
  --danger-hover:#b91c1c;
  --ok:#35c779;
  --border:#2a2a31;
  --secondary:#3b3b47;
  --secondary-hover:#4a4a5a;
}
*{ box-sizing:border-box; }
body{
  margin:0;
  font-family:system-ui,Segoe UI,Roboto,Arial;
  color:var(--text);
  background:linear-gradient(135deg, #0a1833 0%, #162447 60%, #283e5e 100%);
  min-height:100vh;
}
.container{ width:min(1540px,94%); margin:0 auto; }
.site-header{ background:rgba(23,23,27,.85); border-bottom:1px solid var(--border); position:sticky; top:0; backdrop-filter:blur(12px); z-index:10; box-shadow:0 2px 8px rgba(0,0,0,0.1); }
.header-grid{ display:flex; align-items:center; justify-content:space-between; padding:16px 0; }

/* Main content spacing below header */
main.container {
  padding-top: 28px;
  padding-bottom: 40px;
  min-height: calc(100vh - 120px);
}

/* ============================================
   Demande d'animation - UX improvements (page-scoped via classes)
   ============================================ */
/* ============================================
   DEMANDE D'ANIMATION FORM - Clean aligned layout
   ============================================ */
.demande-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.demande-form {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
}

.demande-section {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  padding: 20px;
}

.demande-section legend {
  padding: 0 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

/* Grid layout for 2-column rows - CRITICAL: equal width columns */
.demande-form .grid-2 {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 20px;
  margin-bottom: 16px;
  width: 100%;
}

.demande-form .grid-2:last-child {
  margin-bottom: 0;
}

/* Each label container - MUST be flex column */
.demande-form label {
  display: flex !important;
  flex-direction: column !important;
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
  width: 100%;
}

/* Label text row: keeps text + asterisk on same line */
.demande-form .label-text {
  display: block;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

/* Required asterisk inline with label */
.demande-form .label-text .req {
  color: var(--primary);
  font-weight: 700;
}

/* ALL inputs must be identical width */
/* Annulation fond blanc sur tous les champs demande-form */

.demande-form input::placeholder,
.demande-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.demande-form input:focus,
.demande-form select:focus,
.demande-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Select specific */
.demande-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8b94' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Textarea specific */
.demande-form textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* Hint text below input */
.demande-form .hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
  line-height: 1.3;
}

/* Details/Summary for optional section */
.demande-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.demande-details summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 0;
}

.demande-details summary:hover {
  color: var(--primary);
}

.demande-details[open] summary {
  margin-bottom: 8px;
}

/* Submit section */
.demande-actions {
  margin-top: 8px;
}

/* Responsive: stack on mobile avec meilleure UX */
@media (max-width: 700px) {
  .demande-form .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  .demande-section {
    padding: 16px;
  }
  
  .demande-form input,
  .demande-form select,
  .demande-form textarea {
    font-size: 16px; /* Évite zoom automatique sur iOS */
    padding: 12px;
  }
  
  .demande-form textarea {
    min-height: 120px;
  }
  
  .demande-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
    min-height: 48px;
  }
  
  .demande-wrap {
    width: 98%;
  }
}
.brand{ color:var(--text); text-decoration:none; font-weight:700; font-size:1.15rem; display:flex; align-items:center; gap:8px; transition:opacity 0.2s; }
.brand:hover{ opacity:0.9; }
.nav{ display:flex; gap:16px; list-style:none; margin:0; padding:0; }
.nav a{ 
  color:var(--text); 
  text-decoration:none; 
  transition:all 0.2s ease;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
}
.nav a:hover{ transform:translateY(-1px); }
.nav a[style*="background:var(--primary)"] {
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 2px 4px rgba(220,38,38,0.2);
}
.nav a[style*="background:var(--primary)"]:hover{ 
  background: var(--primary-hover) !important;
  box-shadow: 0 4px 8px rgba(220,38,38,0.3);
}
.nav a[style*="border:1px"]:hover{ background:rgba(255,255,255,0.05); }
.nav a[style*="color:var(--muted)"]:hover{ color:var(--text); }
.site-footer{ border-top:1px solid var(--border); margin-top:40px; padding:20px 0; color:var(--muted); }

/* Footer button styles */
.site-footer a[style*="background:var(--primary)"] {
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(220,38,38,0.2);
}

.site-footer a[style*="background:var(--primary)"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220,38,38,0.3);
}

.site-footer a[style*="border:1px"] {
  transition: all 0.2s ease;
}

.site-footer a[style*="border:1px"]:hover {
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}

.flash-stack{ display:grid; gap:8px; margin:18px 0; }
.flash{ padding:10px 12px; border-radius:10px; background:var(--panel); border:1px solid var(--border); }
.flash-success{ border-color:rgba(53,199,121,.3); } .flash-warning{ border-color:rgba(255,196,0,.35); } .flash-danger{ border-color:rgba(255,92,124,.35); }

/* ============================================
   CARDS GRID - Improved sizing
   ============================================ */
/* Affichage par rangées de six cartes */
/* Grille fixe : 6 cartes par rangée, 3 rangées (18 cartes max par page) */
.cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 1fr;
  max-width: 100%;
}

@media (max-width: 1200px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 800px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .cards {
    grid-template-columns: 1fr;
  }
}


.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;  /* More readable font size */
  min-height: 380px;  /* Increased to accommodate larger images */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Card image container - improved sizing */
.card .media {
  aspect-ratio: 16/10;  /* Slightly wider ratio for better image display */
  min-height: 200px;
  max-height: 280px;  /* Increased to show more of the image */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e0e13;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* max-height retiré, retour à la taille d'origine */
  object-position: center center;  /* Center the image instead of 30% from top */
  display: block;
}

.media-link {
  display: block;
  text-decoration: none;
  position: relative;
}

.media-link:hover .media {
  opacity: .85;
  transform: scale(1.02);
  transition: all .3s ease;
}

.media-link .media {
  transition: all .3s ease;
}

.content-link {
  display: block;
  text-decoration: none;
  color: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-link:hover .content {
  background: rgba(255,255,255,.02);
  transition: background .3s ease;
}

.content-link .content {
  transition: background .3s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-link:hover h3 {
  color: var(--primary);
  transition: color .3s ease;
}

.pdf-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #2a2a31 0%, #1a1a1e 100%);
}

.placeholder {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Card content - improved spacing */
.card .content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  min-height: 2.7em;  /* Reserve space for 2 lines */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .meta:last-child {
  margin-top: auto;
}

.card .desc {
  margin: .25rem 0 0;
  color: #ddd;
  line-height: 1.4;
  display: block;
  overflow: visible;
  text-overflow: clip;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}

/* Card actions */
.card .actions {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.card .actions a,
.card .actions button {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--secondary);
  color: var(--text);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.card .actions a:hover,
.card .actions button:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.card .actions .danger {
  background: var(--danger);
  color: white;
}

.card .actions .danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}

/* ============================================
   FORMS
   ============================================ */
.form {
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.form label {
  display: grid;
  gap: 6px;
}

.form input[type="text"],
.form input[type="password"],
.form input[type="date"],
.form textarea,
.form input[type="file"],
.form input[type="email"] {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #121218;
  color: var(--text);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button,
.actions .btn-secondary {
  padding: 10px 16px;
  --panel:#000000;
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.actions button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220,38,38,0.25);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--secondary-hover);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ============================================
   BUTTONS & LINKS
   ============================================ */
.lost-pass {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  margin-top: 8px;
  background: var(--danger);
  color: #fff !important;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lost-pass:hover {
  background: var(--danger-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239,68,68,0.25);
}

a[href*="edit"] {
  color: var(--primary);
  font-weight: 500;
  transition: all 0.2s ease;
}

a[href*="edit"]:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

.btn {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  color: var(--primary-hover);
}

.publish-btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--primary);
  color: white !important;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(220,38,38,0.2);
}

.publish-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(220,38,38,0.3);
}

/* ============================================
   HORIZONTAL CARD LAYOUT
   ============================================ */
.horizontal-card {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.show-info {
  flex: 1;
}

.show-image {
  max-width: 220px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

/* ============================================
   PAGE LAYOUT (Main + Sidebar)
   ============================================ */
.page-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.page-main {
  flex: 1;
  min-width: 0;
}

.page-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;  /* Below header */
}

.seo-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  margin-top: 0;
}

.seo-block h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.seo-block ul li {
  padding: 0,1px 0;
}

.seo-block ul li a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s ease;
}



.theme-btn {
  transition: all 0.2s ease;
  font-weight: 500;
}



/* ============================================
   RESPONSIVE BREAKPOINTS - MOBILE OPTIMIZED
   ============================================ */

/* Tablettes et petits écrans (< 960px) */
@media (max-width: 960px) {
  .page-layout {
    flex-direction: column;
  }

  .page-sidebar {
    width: 100%;
    position: static;
    order: -1;  /* Move sidebar above cards on mobile */
  }
  
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  
  .container {
    width: 96%;
  }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
  /* Header mobile */
  .header-grid {
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
  }
  
  .brand {
    font-size: 1rem;
  }
  
  .nav {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  
  .nav a {
    padding: 10px 16px;
    text-align: center;
    border: 1px solid var(--border);
  }
  
  /* Boutons CTA plus grands pour le tactile */
  a[style*="background:linear-gradient"],
  button[type="submit"],
  .btn {
    padding: 12px 20px !important;
    font-size: 1rem !important;
    min-height: 44px; /* Taille recommandée pour le tactile */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Formulaire de recherche responsive */
  form[role="search"] {
    flex-direction: column !important;
    padding: 12px !important;
  }
  
  form[role="search"] input {
    width: 100%;
    padding: 12px;
    font-size: 16px; /* Évite le zoom automatique sur iOS */
  }
  
  form[role="search"] button {
    width: 100%;
    padding: 12px;
  }
  
  /* H1 plus petit sur mobile */
  h1 {
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
  }
  
  /* Pagination mobile */
  .pagination {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .pagination a,
  .pagination span {
    min-width: 40px;
    padding: 8px;
  }
}

/* Petits mobiles (< 600px) */
@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
  }
  
  .card {
    min-height: auto;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  /* Images responsive */
  .card .media img {
    max-height: 300px;
    object-fit: cover;
  }
  
  /* Espacement réduit */
  main.container {
    padding-top: 16px;
    padding-bottom: 24px;
  }
  
  .demande-section {
    padding: 14px !important;
  }
  
  /* Boutons empilés verticalement */
  div[style*="display:flex"] > a {
    flex: 1 1 100%;
    min-width: 100% !important;
  }
}

/* Très petits écrans (< 400px) */
@media (max-width: 400px) {
  .container {
    width: 98%;
  }
  
  .brand {
    font-size: 0.95rem;
  }
  
  /* Texte plus petit pour éviter le débordement */
  body {
    font-size: 14px;
  }
  
  h1 {
    font-size: 1rem !important;
  }
  
  .badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
}

/* Optimisations tactiles générales */
@media (hover: none) and (pointer: coarse) {
  /* Appareil tactile détecté */
  
  /* Augmenter la zone de touch */
  a, button, input[type="submit"], input[type="button"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Supprimer les effets hover sur tactile */
  .card:hover {
    transform: none;
  }
  
  /* Feedback tactile */
  a:active, button:active {
    opacity: 0.7;
    transform: scale(0.98);
  }
}

/* Mode paysage mobile */
@media (max-width: 900px) and (orientation: landscape) {
  .header-grid {
    flex-direction: row;
    justify-content: space-between;
  }
  
  .nav {
    flex-direction: row;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted {
  color: var(--muted);
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--ok);
}

.text-danger {
  color: var(--danger);
}

.mt-auto {
  margin-top: auto;
}

.mb-0 {
  margin-bottom: 0;
}
