/**
 * LCF Kadence Child — assets/css/main.css
 * Styles complémentaires, page internes, admin tweaks
 *
 * @package lcf-kadence-child
 */

/* =========================================================
   DOCUMENTS HOME — états spécifiques
   ========================================================= */

/*
 * Lien PDF en mode démo (url='#') — conserve le même style orange que le
 * vrai lien. Aucune opacité réduite : le bouton doit être pleinement visible.
 * La seule différence : pas de cursor "pointer" pour signaler l'absence de fichier.
 */
.lcf-doc-card__dl--demo {
  /* intentionnellement vide : rendu identique au lien réel */
}

/* Message "aucun document" après filtrage AJAX */
.lcf-docs__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--lcf-text-muted);
  font-size: 0.9rem;
}
.lcf-docs__empty::before {
  content: '🔍 ';
}

/* Spinner chargement AJAX (ajouté dynamiquement par JS si besoin) */
.lcf-docs__grid[aria-busy="true"] {
  position: relative;
}
.lcf-docs__grid[aria-busy="true"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.4);
  border-radius: var(--lcf-radius);
  pointer-events: none;
}

/* Colonne admin — style inline léger pour les colonnes CPT */
.column-lcf_dh_icon  { width: 60px;  }
.column-lcf_dh_order { width: 70px;  }
.column-lcf_dh_pdf   { width: 140px; }

/* =========================================================
   DOC CARD — icône image (médiathèque ou URL externe)
   ========================================================= */
/*
 * .lcf-doc-card__icon contient soit un <span> (emoji) soit un <img>.
 * L'image doit remplir la zone icône sans déborder.
 */
.lcf-doc-card__icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* =========================================================
   HERO — SVG décoratif positionné absolument
   ========================================================= */
.lcf-hero {
  position: relative;
  overflow: hidden;
}

.lcf-hero__deco-circle {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 500px;
  height: 500px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

.lcf-hero__inner {
  position: relative;
  z-index: 1;
}

/* =========================================================
   DOC CARD — variante highlight (date limite)
   ========================================================= */
.lcf-doc-card__sub--highlight {
  color: var(--lcf-orange);
  font-weight: 600;
}

/* =========================================================
   FOOTER — copyright
   ========================================================= */
.lcf-footer__copy {
  margin-top: 1rem;
  font-size: 0.7rem;
  color: var(--lcf-text-subtle);
  text-align: center;
}

/* =========================================================
   PAGE INTERNE GÉNÉRIQUE
   ========================================================= */
.lcf-page {
  max-width: var(--lcf-max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.lcf-page__title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--lcf-text-white);
  margin-bottom: 0.5rem;
}

.lcf-page__subtitle {
  font-size: 0.9rem;
  color: var(--lcf-text-muted);
  margin-bottom: 2rem;
}

/* Entry content reset for dark theme */
.entry-content {
  color: var(--lcf-text-light);
  max-width: 800px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--lcf-text-white);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.entry-content a {
  color: var(--lcf-orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.entry-content a:hover { color: var(--lcf-orange-light); }

.entry-content p { margin-bottom: 1rem; }
.entry-content ul,
.entry-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* =========================================================
   BLOG ARCHIVE
   ========================================================= */
.lcf-archive {
  max-width: var(--lcf-max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.lcf-archive__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

/* =========================================================
   SINGLE POST
   ========================================================= */
.lcf-single {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.lcf-single .entry-header {
  margin-bottom: 2rem;
}

.lcf-single .entry-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--lcf-text-white);
  margin-bottom: 0.5rem;
}

.lcf-single .entry-meta {
  font-size: 0.8rem;
  color: var(--lcf-text-muted);
}

.lcf-single .post-thumbnail img {
  width: 100%;
  border-radius: var(--lcf-radius);
  margin-bottom: 2rem;
}

/* =========================================================
   FORMULAIRE NEWSLETTER — État success/error
   ========================================================= */
.lcf-newsletter__msg {
  padding: 0.6rem 1rem;
  border-radius: var(--lcf-radius);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: none;
}
.lcf-newsletter__msg.is-success {
  background: rgba(46, 160, 67, 0.15);
  border: 1px solid rgba(46, 160, 67, 0.4);
  color: #3fb950;
  display: block;
}
.lcf-newsletter__msg.is-error {
  background: rgba(212, 98, 26, 0.15);
  border: 1px solid rgba(212, 98, 26, 0.4);
  color: var(--lcf-orange);
  display: block;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */
.lcf-breadcrumb {
  font-size: 0.75rem;
  color: var(--lcf-text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.lcf-breadcrumb a { color: var(--lcf-orange); }
.lcf-breadcrumb__sep { color: var(--lcf-text-subtle); }

/* =========================================================
   PAGINATION
   ========================================================= */
.lcf-pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 3rem;
}
.lcf-pagination .page-numbers {
  padding: 0.45rem 0.9rem;
  border-radius: var(--lcf-radius);
  border: 1px solid var(--lcf-border-card);
  background: var(--lcf-bg-card);
  color: var(--lcf-text-muted);
  font-size: 0.82rem;
  transition: var(--lcf-transition);
}
.lcf-pagination .page-numbers:hover,
.lcf-pagination .page-numbers.current {
  background: var(--lcf-orange);
  border-color: var(--lcf-orange);
  color: #fff;
}

/* =========================================================
   SEARCH FORM
   ========================================================= */
.lcf-search-form {
  display: flex;
  gap: 0.5rem;
}
.lcf-search-form input[type="search"] {
  flex: 1;
  padding: 0.65rem 1rem;
  background: var(--lcf-bg-card);
  border: 1px solid var(--lcf-border-card);
  border-radius: var(--lcf-radius);
  color: var(--lcf-text-light);
  font-size: 0.9rem;
  outline: none;
}
.lcf-search-form input[type="search"]:focus {
  border-color: var(--lcf-orange);
}
.lcf-search-form button {
  padding: 0.65rem 1.25rem;
  background: var(--lcf-orange);
  border: none;
  border-radius: var(--lcf-radius);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--lcf-transition);
}
.lcf-search-form button:hover { background: var(--lcf-orange-hover); }

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print {
  .lcf-header,
  .lcf-footer,
  .lcf-hero__buttons,
  .lcf-docs__filters,
  .lcf-newsletter,
  .lcf-social {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .lcf-hero { background: #1a3a5c; }
}

/* =========================================================
   ACCESSIBILITY — skip link
   ========================================================= */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99999;
  padding: 0.75rem 1.5rem;
  background: var(--lcf-orange);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 var(--lcf-radius) 0;
  transition: left 0s;
}
.skip-to-content:focus {
  left: 0;
}

/* =========================================================
   SCROLLBAR CUSTOM (Chromium)
   ========================================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--lcf-bg-dark); }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* =========================================================
   ANIMATION — fade-in cards on scroll
   ========================================================= */
@keyframes lcfFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lcf-doc-card,
.lcf-news-card,
.lcf-agenda-item {
  animation: lcfFadeIn 0.35s ease both;
}

.lcf-doc-card:nth-child(1)  { animation-delay: .05s; }
.lcf-doc-card:nth-child(2)  { animation-delay: .10s; }
.lcf-doc-card:nth-child(3)  { animation-delay: .15s; }
.lcf-doc-card:nth-child(4)  { animation-delay: .20s; }
.lcf-doc-card:nth-child(5)  { animation-delay: .25s; }
.lcf-doc-card:nth-child(6)  { animation-delay: .30s; }
.lcf-doc-card:nth-child(7)  { animation-delay: .35s; }
.lcf-doc-card:nth-child(8)  { animation-delay: .40s; }

/* Préfère les mouvements réduits */
@media (prefers-reduced-motion: reduce) {
  .lcf-doc-card,
  .lcf-news-card,
  .lcf-agenda-item {
    animation: none;
  }
}
