/* ═══════════════════════════════════════════════════════════
   home.css — Sections spécifiques : home, about, projects
   Variables et composants partagés → web.css (--w-*)
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
   FILTRE PAR CATÉGORIE (tutos)
───────────────────────────────────────────────────────── */
.hp-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.hp-filter__btn {
  font-family: var(--w-font);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border: var(--w-border) solid var(--w-accent);
  background: transparent;
  color: var(--w-accent);
  cursor: pointer;
  border-radius: var(--w-radius);
  transition: background var(--w-trans), color var(--w-trans);
}

.hp-filter__btn:hover,
.hp-filter__btn.is-active {
  background: var(--w-accent);
  color: #fff;
}

.hp-filter__count {
  font-size: var(--fs-sm);
  color: var(--w-ink-muted);
  margin-top: 1.5rem;
  font-style: italic;
}

/* Tag catégorie sur les cartes */
.hp-card__top-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.hp-card__cats {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.hp-tag {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--w-accent);
  border: 1px solid var(--w-accent);
  padding: 0.1rem 0.45rem;
  border-radius: var(--w-radius);
  opacity: 0.65;
  line-height: 1.4;
}

/* Carte masquée par le filtre */
.hp-card.is-hidden {
  display: none;
}

/* ─────────────────────────────────────────────────────────
   PROJET À LA UNE
───────────────────────────────────────────────────────── */
.hp-featured {
  margin-top: 100px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  padding: 2rem 0 3rem;
}

.hp-featured__inner {
  display: flex;
  width: 58%;
  padding-bottom: 3rem;
  border-bottom: var(--w-border) solid var(--w-accent);
}

.hp-about {
  width: 40%;
  border-bottom: var(--w-border) solid var(--w-accent);
  padding-bottom: 3rem;
}

.hp-about h2 {
  font-size: var(--fs-2xl);
  color: var(--w-accent);
  margin: 0 0 1rem;
}

.hp-featured__cover-link {
  display: block;
  width: 50%;
}

.hp-featured__cover {
  overflow: hidden;
  height: 100%;
  border: var(--w-border) solid var(--w-accent);
}

.hp-featured__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.hp-featured:hover .hp-featured__cover img {
  transform: scale(1.03);
}

.hp-featured__content {
  padding: 0 2rem 2rem 3rem;
  width: 50%;
}

.hp-featured__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 0.75rem;
  color: var(--w-accent);
}

.hp-featured__title a {
  color: inherit;
  text-decoration: none;
}

.hp-featured__subtitle {
  font-size: var(--fs-md);
  color: var(--w-accent);
  line-height: 1.6;
  margin: 0 0 0.5rem;
}

/*.hp-featured__meta {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--w-ink-muted);
  margin: 0 0 1.5rem;
}*/

.hp-wrapper .hp-featured__meta {
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--w-ink-muted);
  text-transform: uppercase;
  margin: auto 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--w-rule);
}

.hp-featured__summary {
  font-size: var(--fs-md);
  color: var(--w-accent);
  letter-spacing: 0.01rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

/* ─────────────────────────────────────────────────────────
   AJUSTEMENTS PAR TEMPLATE
───────────────────────────────────────────────────────── */

/* Pages grille (offset header fixe) */
body[data-template="projects"] .hp-grid,
body[data-template="tutos"] .hp-section,
body[data-template="actus"] .hp-section {
  margin-top: 100px;
}

/* Page about */
body[data-template="about"] .hp-section {
  margin-top: 100px;
  border: none;
  min-height: calc(100vh - 250px);
}

body[data-template="about"] .hp-section .hp-container {
  max-width: 800px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────
   ARTICLE (tuto, actu) — même design que about
───────────────────────────────────────────────────────── */
body[data-template="tuto"] .hp-article,
body[data-template="actu"] .hp-article {
  border: none;
  min-height: calc(100vh - 250px);
}

/* Quand il n'y a pas de cover, l'article prend le margin-top pour le header */
body[data-template="tuto"] .hp-article,
body[data-template="actu"] .hp-article:not(.hp-article--has-cover) {
  margin-top: 100px;
}

.hp-article__container {
  max-width: 800px;
  margin: 0 auto;
}

/* Image de couverture (actu) */
.hp-article__cover {
  margin-top: 100px;
  max-height: 55vh;
  overflow: hidden;
  border-bottom: var(--w-border) solid var(--w-accent);
}

.hp-article__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Header article */
.hp-article__meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0 0 1.25rem;
}

.hp-article__back {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--w-accent);
  text-decoration: none;
  opacity: 0.65;
  transition: opacity var(--w-trans);
}

.hp-article__back:hover {
  opacity: 1;
}

.hp-article__date {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--w-ink-muted);
}

.hp-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.hp-article__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--w-accent);
  margin: 0 0 1.5rem;
}

.hp-article__chapo {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--w-accent);
  border-bottom: var(--w-border) solid var(--w-accent);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.hp-article__chapo p { margin: 0; }

/* Corps de l'article (blocks Kirby) */
.hp-article__body {
  font-size: var(--fs-md);
  line-height: 1.75;
}

.hp-article__body h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--w-ink);
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: var(--w-border) solid var(--w-accent);
}

.hp-article__body h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--w-ink);
  margin: 2rem 0 0.75rem;
}

.hp-article__body ul,
.hp-article__body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25em;
}

.hp-article__body figure {
  margin: 2rem 0;
}

.hp-article__body figure img {
  display: block;
}

.hp-article__body figcaption {
  font-size: var(--fs-2xs);
  color: var(--w-ink-muted);
  padding-top: 0.5rem;
  font-style: italic;
}

/* Intro optionnelle sous le titre de section */
.hp-section__intro {
  font-size: var(--fs-md);
  line-height: 1.6;
  padding-top: cacl(var(--w-gutter)/2);
  padding-bottom: var(--w-gutter);
  max-width: 800px;
  margin: 0 auto;
}


/* ─────────────────────────────────────────────────────────
   ARCHIVES
───────────────────────────────────────────────────────── */
.hp-archive-list {
  border-top: 1px solid var(--w-rule);
}

.hp-archive-item {
  display: grid;
  grid-template-columns: 3rem 72px 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--w-rule);
  transition: background var(--w-trans);
}

.hp-archive-item:hover {
  background: var(--w-paper);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.hp-archive-item__index {
  font-size: var(--fs-2xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--w-ink-muted);
  font-family: 'Inconsolata', monospace;
}

.hp-archive-item__thumb {
  width: 72px;
  height: 52px;
  overflow: hidden;
  flex-shrink: 0;
}

.hp-archive-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(20%);
  transition: filter var(--w-trans);
}

.hp-archive-item:hover .hp-archive-item__thumb img {
  filter: grayscale(0%);
}

.hp-archive-item__content {
  min-width: 0;
}

.hp-archive-item__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin: 0 0 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-archive-item__title a {
  color: var(--w-ink);
  text-decoration: none;
  transition: color var(--w-trans);
}

.hp-archive-item__title a:hover {
  color: var(--w-accent);
}

.hp-archive-item__subtitle {
  font-size: var(--fs-2xs);
  color: var(--w-ink-muted);
}

.hp-archive-item__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.hp-archive-item__count {
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--w-ink-muted);
}

.hp-archive-item__arrow {
  color: var(--w-ink-muted);
  text-decoration: none;
  font-size: 1rem;
  transition: color var(--w-trans), transform var(--w-trans);
  display: inline-block;
}

.hp-archive-item:hover .hp-archive-item__arrow {
  color: var(--w-accent);
  transform: translateX(3px);
}

.hp-archive-item:not(:has(.hp-archive-item__thumb)) {
  grid-template-columns: 3rem 1fr auto;
}

/* Lien "voir tout" sous une grille */
.hp-section__more {
  margin-top: 2rem;
  text-align: right;
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hp-featured {
    flex-direction: column;
  }

  .hp-featured__inner {
    width: 100%;
  }

  .hp-featured__cover-link {
    width: 100%;
  }

  .hp-featured__content {
    width: 100%;
    padding: 2rem 0;
  }

  .hp-featured__title {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
  }

  .hp-about {
    width: 100%;
    margin-top: 2rem;
  }

  .hp-archive-item {
    grid-template-columns: 3rem 1fr auto;
    gap: 1rem;
  }

  .hp-archive-item__thumb {
    display: none;
  }
}
