/* ────────────────────────────────────────────────────────
   Training Days — Blog styles
   Chargé uniquement sur is_home() et is_single()
──────────────────────────────────────────────────────── */

:root {
  --td-blue:     #1E3A8A;
  --td-blue-2:   #1E40AF;
  --td-blue-3:   #2563EB;
  --td-bg:       #F7F9FC;
  --td-heading:  'Outfit', system-ui, sans-serif;
  --td-body:     'Inter', system-ui, sans-serif;
}

/* ── Reset minimal ── */
.td-wrap * { box-sizing: border-box; }
.td-wrap a { text-decoration: none; color: inherit; }
.td-wrap img { display: block; max-width: 100%; }

/* ── Hero ── */
.td-hero {
  background: linear-gradient(135deg, var(--td-blue) 0%, var(--td-blue-2) 50%, var(--td-blue-3) 100%);
  position: relative;
  overflow: hidden;
}
.td-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.td-hero::after {
  content: '';
  position: absolute;
  top: -150px; right: -150px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,0.15) 0%, transparent 65%);
  pointer-events: none;
}
.td-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .td-hero-inner { grid-template-columns: 1fr 1fr; }
}

/* ── Container ── */
.td-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Search box ── */
.td-search-wrap {
  display: flex;
  gap: 8px;
}
.td-search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
}
body .td-wrap .td-search-field input,
body .td-wrap .td-search-field input[type="text"],
body .td-wrap .td-search-field input[type="search"] {
  background: transparent !important;
  border: none !important;
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 14px !important;
  width: 100%;
  font-family: var(--td-body);
  padding: 0 !important;
}
body .td-wrap .td-search-field input::placeholder { color: rgba(255,255,255,0.5) !important; }

body .td-wrap button.td-search-btn,
body .td-wrap button.td-search-btn:hover,
body .td-wrap button.td-search-btn:focus,
body .td-wrap button.td-search-btn:active {
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #fff !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,0.18) !important;
  border: 1px solid rgba(255,255,255,0.25) !important;
  border-color: rgba(255,255,255,0.25) !important;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--td-body);
  box-shadow: none !important;
  text-decoration: none !important;
}

/* ── Filtres catégories ── */
.td-cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2.5rem;
}
body .td-wrap button.td-cat-pill,
body .td-wrap button.td-cat-pill:focus {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 4px 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border: 1px solid #E5E7EB !important;
  border-color: #E5E7EB !important;
  background: #fff !important;
  color: #4B5563 !important;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--td-body);
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
}
body .td-wrap button.td-cat-pill:hover,
body .td-wrap button.td-cat-pill.active {
  background: #1E3A8A !important;
  color: #fff !important;
  border: 1px solid #1E3A8A !important;
  border-color: #1E3A8A !important;
}

/* ── Featured card ── */
.td-featured-card {
  display: grid;
  background: #fff;
  border: 1px solid #E8EDF4;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(30,58,138,0.06);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}
@media (min-width: 768px) {
  .td-featured-card { grid-template-columns: 3fr 2fr; }
}
.td-featured-card:hover {
  box-shadow: 0 8px 40px rgba(30,58,138,0.12);
  transform: translateY(-2px);
}
.td-featured-img {
  overflow: hidden;
  min-height: 260px;
}
.td-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.td-featured-card:hover .td-featured-img img { transform: scale(1.04); }
.td-featured-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Articles grid ── */
.td-articles-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-bottom: 0;
}
@media (min-width: 640px)  { .td-articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .td-articles-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Article card ── */
.td-article-card {
  background: #fff;
  border: 1px solid #E8EDF4;
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.td-article-card:hover {
  box-shadow: 0 6px 30px rgba(30,58,138,0.1);
  transform: translateY(-2px);
}
.td-card-img {
  height: 180px;
  overflow: hidden;
}
.td-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.td-article-card:hover .td-card-img img { transform: scale(1.04); }
.td-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }

/* ── Badge catégorie ── */
.td-cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #EFF6FF;
  color: var(--td-blue);
  margin-bottom: 0.75rem;
}

/* ── Pagination ── */
.td-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2.5rem 0 4rem;
  flex-wrap: wrap;
}
.td-page-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #E5E7EB;
  background: #fff;
  color: #4B5563;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-family: var(--td-body);
}
.td-page-btn:hover    { border-color: var(--td-blue); color: var(--td-blue); }
.td-page-btn.active   { background: var(--td-blue); color: #fff; border-color: var(--td-blue); }
.td-page-btn.disabled { opacity: 0.4; pointer-events: none; cursor: default; }
.td-page-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #9CA3AF;
  font-size: 14px;
}

/* ── Loading overlay ── */
#td-results {
  transition: opacity 0.2s;
}
#td-results.td-loading {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Empty state ── */
.td-empty {
  text-align: center;
  padding: 5rem 1rem;
}
.td-empty svg { margin: 0 auto 1rem; display: block; }
.td-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem;
  font-family: var(--td-heading);
}
.td-empty-sub {
  font-size: 14px;
  color: #9CA3AF;
  margin: 0;
}

/* ── Newsletter ── */
.td-newsletter {
  background: linear-gradient(135deg, var(--td-blue) 0%, var(--td-blue-3) 100%);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  padding: 3rem 2rem;
  margin-top: 3rem;
  margin-bottom: 40px;
}
@media (min-width: 768px) { .td-newsletter { padding: 3.5rem; } }
.td-newsletter::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.td-newsletter-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 768px) { .td-newsletter-grid { grid-template-columns: 1fr 1fr; } }
body .td-wrap .td-newsletter-input,
body .td-wrap input.td-newsletter-input,
body .td-wrap input[type="email"].td-newsletter-input {
  flex: 1;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  border-color: rgba(255,255,255,0.2) !important;
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
  font-size: 14px !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: var(--td-body);
}
body .td-wrap .td-newsletter-input::placeholder { color: rgba(255,255,255,0.5) !important; }
body .td-wrap .td-newsletter-input:focus {
  border-color: rgba(255,255,255,0.5) !important;
  background: rgba(255,255,255,0.15) !important;
  box-shadow: none !important;
  outline: none !important;
}
body .td-wrap button.td-newsletter-btn,
body .td-wrap button.td-newsletter-btn:hover,
body .td-wrap button.td-newsletter-btn:focus,
body .td-wrap button.td-newsletter-btn:active {
  flex-shrink: 0;
  padding: 12px 20px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #1E3A8A !important;
  border: none !important;
  border-color: transparent !important;
  cursor: pointer;
  font-family: var(--td-body);
  box-shadow: none !important;
  text-decoration: none !important;
}

/* ── Article single ── */
.td-single-content {
  font-family: var(--td-body);
  font-size: 16px;
  line-height: 1.8;
  color: #374151;
}
.td-single-content h2 {
  font-family: var(--td-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 2rem 0 1rem;
  line-height: 1.3;
}
.td-single-content h3 {
  font-family: var(--td-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  margin: 1.5rem 0 0.75rem;
}
.td-single-content p  { margin: 0 0 1.25rem; }
.td-single-content ul,
.td-single-content ol { padding-left: 1.5rem; margin: 0 0 1.25rem; }
.td-single-content li { margin-bottom: 0.5rem; }
.td-single-content strong { color: #111827; }
.td-single-content a  { color: var(--td-blue); }
.td-single-content blockquote {
  border-left: 4px solid var(--td-blue);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: #6B7280;
  font-style: italic;
}
.td-single-content img {
  border-radius: 12px;
  margin: 1.5rem auto;
}
.td-single-content .wp-block-image figcaption {
  text-align: center;
  font-size: 13px;
  color: #9CA3AF;
  margin-top: 8px;
}


/* ── Article pro layout v2 ── */
#td-reading-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, #1E3A8A, #3B82F6);
  width: 0%; z-index: 9999; transition: width 0.12s linear;
}

.td-ap-wrap { background: #fff; }

.td-ap-header {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

.td-ap-crumb {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #9CA3AF; margin-bottom: 1.5rem;
}
.td-ap-crumb a { color: #9CA3AF; text-decoration: none; }
.td-ap-crumb a:hover { color: #1E3A8A; }
.td-ap-crumb span { color: #374151; font-weight: 500; }

.td-ap-cat { margin-bottom: 1.25rem !important; display: inline-block !important; }

.td-ap-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #0F172A;
  line-height: 1.15;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

.td-ap-meta {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px; color: #6B7280;
  padding: 10px 20px;
  background: #F8FAFC;
  border-radius: 999px;
  border: 1px solid #E2E8F0;
}
.td-ap-meta-dot { color: #CBD5E1; }

.td-ap-img {
  max-width: 1100px; margin: 0 auto 0;
  padding: 0 1.5rem 3rem;
}
.td-ap-img img {
  width: 100%; height: auto; aspect-ratio: 16/7;
  object-fit: cover; border-radius: 20px;
  display: block;
  box-shadow: 0 8px 40px rgba(15,23,42,0.1);
}

.td-ap-layout {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 5rem; align-items: start;
}
@media (max-width: 1024px) {
  .td-ap-layout { grid-template-columns: 1fr; }
  .td-ap-sidebar { display: none; }
}

/* Sidebar */
.td-ap-sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1.25rem; }

.td-ap-toc { background: #F8FAFF; border: 1px solid #DBEAFE; border-radius: 16px; padding: 1.25rem; }
.td-ap-toc-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #1E3A8A; margin: 0 0 1rem; }
#td-ap-toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.td-toc-link { font-size: 13px; color: #64748B; text-decoration: none; display: block; padding: 5px 10px; border-radius: 8px; border-left: 2px solid transparent; transition: all 0.15s; line-height: 1.45; }
.td-toc-link:hover, .td-toc-link.active { color: #1E3A8A; background: #EFF6FF; border-left-color: #1E3A8A; }
.td-toc-link.active { font-weight: 600; }

.td-ap-nl {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
  border-radius: 16px; padding: 1.5rem;
}
.td-ap-nl-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,0.45); margin: 0 0 0.5rem; }
.td-ap-nl-title { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 1.25rem; line-height: 1.35; }
.td-ap-nl-btn { display: block; text-align: center; padding: 10px 16px; background: #fff; color: #1E3A8A; font-size: 13px; font-weight: 700; border-radius: 10px; text-decoration: none; }
.td-ap-nl-btn:hover { background: #EFF6FF; }

/* Content */
.td-ap-content.td-single-content { font-size: 17px; line-height: 1.85; color: #334155; }
.td-ap-content.td-single-content > p:first-child { font-size: 19px; color: #1E293B; line-height: 1.75; font-weight: 400; }
.td-ap-content.td-single-content h2 { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 700; color: #0F172A; margin: 2.75rem 0 1rem; line-height: 1.25; }
.td-ap-content.td-single-content h3 { font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 700; color: #1E293B; margin: 2rem 0 0.75rem; }
.td-ap-content.td-single-content strong { color: #0F172A; }
.td-ap-content.td-single-content blockquote { border-left: 3px solid #1E3A8A; padding: 0.5rem 0 0.5rem 1.5rem; margin: 2rem 0; color: #475569; font-style: italic; }

/* CTA */
.td-ap-cta-wrap { max-width: 780px; margin: 0 auto; padding: 0 1.5rem 2rem; }

/* Back */
.td-ap-back-wrap { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; border-top: 1px solid #F1F5F9; }
.td-ap-back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #64748B; text-decoration: none; }
.td-ap-back-link:hover { color: #1E3A8A; }
