/**
 * ElectronLibre — Design tokens + composants partagés (archives + article)
 * Tokens globaux : assets/el-tokens.css
 */

.el-reset-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Neutralise les restes Masonry / grille Follow sur les pages patchées */
body.el-home-page .blog-grid-view,
body.el-archive-page .blog-grid-view {
  margin: 0 !important;
}

body.el-home-page .blog-grid-view > div[id^="post-"],
body.el-home-page .blog-grid-view > article[id^="post-"],
body.el-archive-page .blog-grid-view > div[id^="post-"],
body.el-archive-page .blog-grid-view > article[id^="post-"] {
  width: auto !important;
  padding: 0 !important;
  float: none !important;
  position: static !important;
}

/* Remplace les variables Google Fonts du thème parent sur les pages patchées */
body.el-home-page,
body.el-archive-page,
body.el-single-page,
body.el-secondary-page {
  --primary-font: var(--el-font-ui);
  --secondary-font: var(--el-font-editorial);
  --site-identity-font-family: var(--el-font-editorial);
  font-family: var(--el-font-editorial);
  color: #1f2937;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.el-home-page .archive-wrapper,
body.el-archive-page .archive-wrapper,
body.el-single-page .inside-page.content-area,
body.el-secondary-page .archive-wrapper {
  margin-top: 0;
  margin-bottom: 0;
}

/* --- Shell --- */
.el-archive-shell,
.el-home-shell,
.el-single-shell,
.el-search-shell,
.el-static-shell,
.el-error-shell {
  max-width: calc(var(--el-content-width) + (2 * var(--el-page-pad)));
  margin: 0 auto;
  padding: 18px var(--el-page-pad) 48px;
}

.el-single-shell {
  padding-bottom: 48px;
}

.el-archive-shell .archive-wrapper,
.el-archive-shell .site-main,
.el-home-shell .archive-wrapper,
.el-home-shell .site-main {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* --- Titre de section (newsletter) --- */
.el-section-head {
  margin: 0 0 14px;
  margin-left: calc(-1 * var(--el-section-hang));
}

.el-section-head--inset {
  margin-left: 0;
}

.el-section-head__title {
  margin: 0;
  font-family: var(--el-font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
  color: #64748b;
}

.el-section-head__title a {
  color: inherit;
  text-decoration: none;
}

.el-section-head__title a:hover {
  color: var(--el-accent);
}

.el-section-head__desc {
  margin: 8px 0 0;
  max-width: 52ch;
  font-family: var(--el-font-ui);
  font-size: 0.92rem;
  line-height: 1.5;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* --- Fil d'Ariane --- */
.el-breadcrumb {
  margin: 0 0 12px;
  margin-left: calc(-1 * var(--el-section-hang));
}

.el-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--el-font-ui);
  font-size: 0.78rem;
  line-height: 1.4;
  color: #64748b;
}

.el-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.el-breadcrumb__item:not(:last-child)::after {
  content: "›";
  margin-left: 6px;
  color: #94a3b8;
  font-weight: 400;
}

.el-breadcrumb__link {
  color: #64748b;
  text-decoration: none;
}

.el-breadcrumb__link:hover {
  color: var(--el-accent);
}

.el-breadcrumb__current {
  color: #334155;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(48ch, 100%);
}

/* --- Carte éditoriale --- */
.el-card,
.el-single-article-card,
.el-archive-page .blog-grid-view .news-snippet,
.el-single-page .related-posts .post-holder > .news-snippet {
  padding: 22px;
  border-radius: var(--el-radius-lg);
  background: var(--el-surface);
  border: 1px solid var(--el-border);
  box-shadow: var(--el-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.el-single-article-card {
  padding: 28px 32px;
}

.el-archive-page .blog-grid-view .news-snippet:hover,
.el-single-page .related-posts .post-holder > .news-snippet:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
}

/* --- Grille 12 colonnes (archives + related) --- */
.el-card-grid,
.el-archive-page .blog-grid-view,
.el-single-page .related-posts .post-holder {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.el-card-grid > div[id^="post-"],
.el-card-grid > article[id^="post-"],
.el-archive-page .blog-grid-view > div[id^="post-"],
.el-archive-page .blog-grid-view > article[id^="post-"],
.el-single-page .related-posts .post-holder > .news-snippet {
  grid-column: span 4;
}

.el-card-grid > div[id^="post-"]:first-child,
.el-card-grid > article[id^="post-"]:first-child,
.el-archive-page .blog-grid-view > div[id^="post-"]:first-child,
.el-archive-page .blog-grid-view > article[id^="post-"]:first-child {
  grid-column: span 12;
}

.el-archive-page .blog-grid-view > div[id^="post-"]:first-child .news-snippet,
.el-archive-page .blog-grid-view > article[id^="post-"]:first-child .news-snippet {
  padding: 28px 32px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

/* --- Meta + pills --- */
.el-archive-page .blog-grid-view .ihead,
.el-archive-page .blog-grid-view .ihead .list-inline,
.el-single-page .author-info,
.el-single-page .single-post .post-meta,
.el-single-page .single-post .ihead,
.el-single-page .related-posts .info,
.el-single-page .related-posts .list-inline {
  font-family: var(--el-font-ui);
  font-size: 0.82rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-style: normal;
}

.el-archive-page .blog-grid-view .ihead .list-inline,
.el-single-page .single-post .ihead .list-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.el-archive-page .blog-grid-view .ihead .list-inline li,
.el-single-page .single-post .ihead .list-inline li {
  margin: 0;
}

.el-archive-page .blog-grid-view .ihead .list-inline a,
.el-single-page .single-post .ihead .list-inline a {
  color: inherit;
  text-decoration: none;
  background: none;
}

.el-archive-page .blog-grid-view .ihead .list-inline a:hover,
.el-single-page .single-post .ihead .list-inline a:hover {
  color: var(--el-accent);
}

.el-single-page .single-post .ihead .post-author::before {
  display: none;
}

.el-pill,
.el-archive-page .blog-grid-view .category a,
.el-archive-page .blog-grid-view .tags a,
.el-single-page .single-post .category a,
.el-single-page .el-single-article-card .category a,
.el-single-page .ai-keywords-list li {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--el-accent-soft);
  color: var(--el-accent) !important;
  font-family: var(--el-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
}

.el-single-page .ai-keywords-list li {
  cursor: pointer;
  max-width: 100%;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.el-single-page .ai-keywords-list li:hover {
  background: #dbeafe;
  color: #1d4ed8 !important;
  transform: none;
}

.el-single-page .ai-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  width: 100%;
  align-items: flex-start;
}

/* --- Archives (home / catégories) --- */
.el-archive-page .archive-wrapper {
  max-width: none;
}

.el-archive-page .blog-grid-view {
  gap: 24px !important;
  row-gap: 24px !important;
}

.el-archive-page .blog-grid-view .news-snippet {
  height: 100%;
  gap: 12px !important;
}

.el-archive-page .blog-grid-view > div[id^="post-"]:first-child .news-snippet .summary,
.el-archive-page .blog-grid-view > article[id^="post-"]:first-child .news-snippet .summary,
.el-archive-page .blog-grid-view > div[id^="post-"]:first-child .news-snippet .ihead,
.el-archive-page .blog-grid-view > article[id^="post-"]:first-child .news-snippet .ihead {
  width: 100%;
  max-width: none;
}

.el-archive-page .pagination,
.el-archive-page .nav-links {
  margin-top: 28px;
  font-family: var(--el-font-ui);
}

/* --- Titres éditoriaux --- */
.el-title,
.el-archive-page .blog-grid-view .news-title,
.el-archive-page .blog-grid-view .news-title a,
.el-single-page .related-posts .news-title,
.el-single-page .related-posts .news-title a {
  font-family: var(--el-font-editorial);
  line-height: 1.18;
  color: #111827;
}

.el-archive-page .blog-grid-view .news-title,
.el-archive-page .blog-grid-view .news-title a {
  font-size: clamp(1.35rem, 2vw, 1.75rem) !important;
  max-width: none;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  color: #111827 !important;
  font-family: var(--el-font-editorial) !important;
  line-height: 1.18 !important;
}

.el-archive-page .blog-grid-view .news-snippet .news-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.el-archive-page .blog-grid-view > div[id^="post-"]:first-child .news-title,
.el-archive-page .blog-grid-view > div[id^="post-"]:first-child .news-title a,
.el-archive-page .blog-grid-view > article[id^="post-"]:first-child .news-title,
.el-archive-page .blog-grid-view > article[id^="post-"]:first-child .news-title a {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem) !important;
  width: 100%;
}

.el-single-page .related-posts .news-title,
.el-single-page .related-posts .news-title a {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem) !important;
  line-height: 1.22 !important;
}

/* --- Extrait --- */
.el-archive-page .blog-grid-view .excerpt {
  color: #475569;
  font-family: var(--el-font-ui);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 70ch;
  margin-top: 8px !important;
}

.el-archive-page .blog-grid-view .summary {
  margin-top: 0;
}

.el-archive-page .blog-grid-view .summary .category,
.el-archive-page .blog-grid-view .summary .tags {
  margin-top: 10px;
  margin-bottom: 0;
  gap: 6px;
}

.el-archive-page .blog-grid-view > div[id^="post-"]:first-child .excerpt,
.el-archive-page .blog-grid-view > article[id^="post-"]:first-child .excerpt {
  max-width: none !important;
  width: 100%;
  font-size: 1.02rem;
  line-height: 1.6;
}

.el-archive-page .blog-grid-view .readmore {
  font-family: var(--el-font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--el-accent) !important;
}

@media (max-width: 1100px) {
  .el-card-grid > div[id^="post-"],
  .el-card-grid > article[id^="post-"],
  .el-archive-page .blog-grid-view > div[id^="post-"],
  .el-archive-page .blog-grid-view > article[id^="post-"],
  .el-single-page .related-posts .post-holder > .news-snippet {
    grid-column: span 6;
  }

  .el-card-grid > div[id^="post-"]:first-child,
  .el-card-grid > article[id^="post-"]:first-child,
  .el-archive-page .blog-grid-view > div[id^="post-"]:first-child,
  .el-archive-page .blog-grid-view > article[id^="post-"]:first-child {
    grid-column: span 12;
  }
}

@media (max-width: 780px) {
  .el-archive-shell,
  .el-home-shell,
  .el-single-shell {
    padding-top: 14px;
  }

  .el-section-head {
    margin-bottom: 12px;
    margin-left: 0;
  }

  .el-breadcrumb {
    margin-left: 0;
  }

  .el-breadcrumb__current {
    white-space: normal;
    max-width: none;
  }

  .el-card-grid,
  .el-archive-page .blog-grid-view,
  .el-single-page .related-posts .post-holder {
    grid-template-columns: 1fr;
  }

  .el-card-grid > div[id^="post-"],
  .el-card-grid > article[id^="post-"],
  .el-card-grid > div[id^="post-"]:first-child,
  .el-card-grid > article[id^="post-"]:first-child,
  .el-archive-page .blog-grid-view > div[id^="post-"],
  .el-archive-page .blog-grid-view > article[id^="post-"],
  .el-archive-page .blog-grid-view > div[id^="post-"]:first-child,
  .el-archive-page .blog-grid-view > article[id^="post-"]:first-child,
  .el-single-page .related-posts .post-holder > .news-snippet {
    grid-column: span 1;
  }
}

.info .comments,
.el-archive-page .blog-grid-view .readmore,
.el-card-grid .readmore,
.comments-area,
#comments {
  display: none !important;
}

body.el-static-page .el-static-page-card__comments .comments-area,
body.el-static-page .el-static-page-card__comments #comments {
  display: block !important;
}

/* --- Pages secondaires (recherche, statiques, 404) --- */
body.el-secondary-page .main-wrapper,
body.el-secondary-page .inside-page.content-area,
body.el-secondary-page .sidebar {
  max-width: none;
  width: auto;
  margin: 0;
  padding: 0;
  float: none;
}

body.el-secondary-page .container {
  max-width: none;
  width: auto;
  padding: 0;
}

.el-search-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.el-search-result,
.el-static-page-card,
.el-empty-state {
  padding: 22px 24px;
  border-radius: var(--el-radius-lg);
  background: var(--el-surface);
  border: 1px solid var(--el-border);
  box-shadow: var(--el-shadow);
}

.el-static-page-card {
  padding: 28px 32px;
}

.el-search-result__title,
.el-search-result__title a {
  margin: 0 0 10px;
  font-family: var(--el-font-editorial);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.22;
  color: #111827;
  text-decoration: none;
}

.el-search-result__title a:hover {
  color: var(--el-accent);
}

.el-search-result__excerpt,
.el-static-page-card .entry-content,
.el-empty-state__content p,
.el-error-card__lead {
  margin: 0;
  font-family: var(--el-font-ui);
  font-size: 0.98rem;
  line-height: 1.6;
  color: #475569;
}

.el-static-page-card .entry-content > :first-child {
  margin-top: 0;
}

.el-static-page-card .entry-content h2,
.el-static-page-card .entry-content h3,
.el-static-page-card .entry-content h4 {
  font-family: var(--el-font-editorial);
  color: #111827;
  line-height: 1.25;
}

.el-static-page-card .entry-content a {
  color: var(--el-accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.el-static-page-card .entry-content a:hover {
  color: #1d4ed8;
}

.el-static-page-card .page-links {
  margin-top: 24px;
  font-family: var(--el-font-ui);
  font-size: 0.9rem;
  color: #64748b;
}

.el-empty-state__title {
  margin: 0 0 12px;
  font-family: var(--el-font-editorial);
  font-size: 1.25rem;
  color: #111827;
}

.el-error-card {
  text-align: center;
}

.el-error-card__lead {
  margin-bottom: 18px;
}

.el-error-card__back {
  margin: 18px 0 0;
  font-family: var(--el-font-ui);
  font-size: 0.92rem;
}

.el-error-card__back a {
  color: var(--el-accent);
  font-weight: 600;
  text-decoration: none;
}

.el-error-card__back a:hover {
  text-decoration: underline;
}

body.el-secondary-page .search-form,
.el-empty-state .search-form,
.el-error-card .search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

body.el-secondary-page .search-form label,
.el-empty-state .search-form label,
.el-error-card .search-form label {
  width: 100%;
  max-width: 420px;
  margin: 0;
}

body.el-secondary-page .search-form .search-field,
.el-empty-state .search-form .search-field,
.el-error-card .search-form .search-field {
  width: 100%;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius-md);
  background: var(--el-surface-alt);
  font-family: var(--el-font-ui);
  font-size: 0.95rem;
  color: #111827;
}

body.el-secondary-page .search-form .search-field:focus,
.el-empty-state .search-form .search-field:focus,
.el-error-card .search-form .search-field:focus {
  outline: 2px solid rgba(47, 109, 251, 0.25);
  border-color: var(--el-accent);
  background: var(--el-surface);
}

body.el-secondary-page .search-form input[type="submit"],
.el-empty-state .search-form input[type="submit"],
.el-error-card .search-form input[type="submit"] {
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--el-accent);
  color: #fff;
  font-family: var(--el-font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

body.el-secondary-page .search-form input[type="submit"]:hover,
.el-empty-state .search-form input[type="submit"]:hover,
.el-error-card .search-form input[type="submit"]:hover {
  background: #1d4ed8;
}

body.el-search-page .pagination,
body.el-search-page .nav-links {
  margin-top: 28px;
  font-family: var(--el-font-ui);
}

@media (max-width: 780px) {
  .el-search-shell,
  .el-static-shell,
  .el-error-shell {
    padding-top: 14px;
    padding-bottom: 36px;
  }

  .el-static-page-card {
    padding: 22px 20px;
  }
}
