/* Accueil (bandeau + blog) et pages d'articles */

/* ── Bandeau ───────────────────────────────────────────────────────── */

.h-hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 28px 130px;
  color: #fff;
  background: #0d0e13;
  overflow: hidden;
}

.h-slides { position: absolute; inset: 0; z-index: -2; }

.h-slide {
  position: absolute;
  inset: -24px;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(0.55) saturate(1.15);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1.6s ease;
}

.h-slide.on { opacity: 1; animation: h-zoom 14s ease-out forwards; }

@keyframes h-zoom {
  from { transform: scale(1.05); }
  to   { transform: scale(1.14); }
}

.h-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(13, 14, 19, 0.65) 0, rgba(13, 14, 19, 0) 220px),
    linear-gradient(0deg, rgba(13, 14, 19, 0.7) 0, rgba(13, 14, 19, 0) 200px),
    radial-gradient(ellipse at 50% 45%, rgba(13, 14, 19, 0) 0%, rgba(13, 14, 19, 0.55) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.14) 0 2px, transparent 2px 4px);
}

.h-hero-inner { max-width: 820px; }

.h-logo {
  width: 230px;
  max-width: 60%;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.5));
  animation: h-float 4s ease-in-out infinite;
}

@keyframes h-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.h-hero h1 {
  font-size: 64px;
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 30px 0 14px;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.55);
}

.h-tagline {
  font-size: 22px;
  line-height: 1.5;
  margin: 0 0 40px;
  color: #eef0f6;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6);
}

.h-tagline em {
  font-style: normal;
  color: #1bd96a;
  padding-bottom: 2px;
  border-bottom: 4px solid #1bd96a;
}

/* Pastilles Minecraft · Fabric · version */
.h-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 30px 0 0; }

.h-meta span {
  padding: 2px 14px;
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e4e6ee;
  background: rgba(10, 11, 16, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
}

/* Logos Modrinth / CurseForge (SVG affichés en masque, ils prennent la couleur du texte) */
.h-ico {
  display: inline-block;
  flex: none;
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.h-ico.modrinth { --src: url("../img/brands/modrinth.svg"); }
.h-ico.curseforge { --src: url("../img/brands/curseforge.svg"); }

/* ── Boutons ───────────────────────────────────────────────────────── */

.h-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; }

.h-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 250px;
  padding: 18px 32px;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  border-bottom: 5px solid rgba(0, 0, 0, 0.45);
  transition: transform 0.1s, filter 0.15s;
}

.h-btn:hover { transform: translateY(-3px); filter: brightness(1.12); }
.h-btn:active { transform: translateY(1px); border-bottom-width: 2px; }
.h-btn.modrinth { background: #1bd96a; color: #08210f; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4), 0 12px 34px rgba(27, 217, 106, 0.3); }
.h-btn.curseforge { background: #f16436; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28), 0 12px 34px rgba(241, 100, 54, 0.3); }

/* ── Barre de navigation transparente sur le bandeau ───────────────── */

.is-home .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, backdrop-filter 0.25s;
}

/* Logo : « Basique » en blanc, « MOD » garde ses couleurs.
   Deux images superposées, fondu de l'une à l'autre quand la barre devient pleine. */
.is-home .topbar .logo-white { display: block; position: absolute; left: 0; top: 0; opacity: 1; transition: opacity 0.25s; }
.is-home .topbar .logo-base { opacity: 0; transition: opacity 0.25s; }
.is-home .topbar.solid .logo-white { opacity: 0; }
.is-home .topbar.solid .logo-base { opacity: 1; }
.is-home .topbar .tabs a,
.is-home .topbar .version-pill,
.is-home .topbar .lang-switch,
.is-home .topbar .search input,
.is-home .topbar .search button,
.is-home .topbar .menu-toggle { color: rgba(255, 255, 255, 0.82); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); transition: color 0.25s; }
.is-home .topbar .search input::placeholder { color: rgba(255, 255, 255, 0.6); }
.is-home .topbar .tabs a:hover,
.is-home .topbar .tabs a.active { color: #fff; }

.is-home .topbar.solid {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.is-home .topbar.solid .tabs a,
.is-home .topbar.solid .version-pill,
.is-home .topbar.solid .lang-switch,
.is-home .topbar.solid .search input,
.is-home .topbar.solid .search button,
.is-home .topbar.solid .menu-toggle { color: var(--muted); text-shadow: none; }
.is-home .topbar.solid .search input { color: var(--ink); }
.is-home .topbar.solid .search input::placeholder { color: var(--muted); }
.is-home .topbar.solid .search button { color: var(--ink); }
.is-home .topbar.solid .tabs a:hover,
.is-home .topbar.solid .tabs a.active { color: var(--ink); }

/* Petits carrés lumineux qui montent dans le bandeau */

.h-sparks { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.h-sparks i {
  position: absolute;
  bottom: -20px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  opacity: 0;
  animation: h-rise var(--d) linear var(--t) infinite;
}

@keyframes h-rise {
  0%   { transform: translateY(0) rotate(0); opacity: 0; }
  15%  { opacity: 0.8; }
  100% { transform: translateY(-105vh) rotate(180deg); opacity: 0; }
}

/* Points du diaporama */

.h-dots { position: absolute; left: 0; right: 0; bottom: 40px; display: flex; justify-content: center; gap: 10px; }

.h-dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.h-dots button:hover { transform: scale(1.25); }
.h-dots button.on { background: #fff; }

/* Entrée du contenu du bandeau */

.h-hero-inner > * { animation: h-in 0.8s ease both; }
.h-hero-inner > :nth-child(2) { animation-delay: 0.1s; }
.h-hero-inner > :nth-child(3) { animation-delay: 0.2s; }
.h-hero-inner > :nth-child(4) { animation-delay: 0.3s; }
.h-hero-inner > :nth-child(5) { animation-delay: 0.4s; }

@keyframes h-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ── Blog ──────────────────────────────────────────────────────────── */

.h-blog { max-width: 1180px; margin: 0 auto; padding: 96px 36px 112px; }
.h-kicker { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

.blog-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 36px; }
.h-blog h2 { font-size: 36px; font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }

/* Filtres par catégorie */
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; }

.blog-filters button {
  font: inherit;
  font-size: 11px;
  line-height: 1.8;
  padding: 3px 14px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.blog-filters button:hover { color: var(--ink); border-color: var(--ink); }
.blog-filters button.on { color: #fff; background: var(--ink); border-color: var(--ink); }

/* Grille : 1re carte en grand, les autres sur 3 colonnes */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.blog-card[hidden] { display: none; }
.blog-card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 7px 7px 0 var(--ink); }

.blog-card .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #14151a; border-bottom: 1px solid var(--line); }
.blog-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s; }
.blog-card:hover .thumb img { transform: scale(1.06); }

.blog-card .b { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 18px; }
.blog-card .top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.blog-card .d { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.blog-card h3 { font-size: 18px; font-weight: 400; line-height: 1.35; margin: 0 0 8px; }
.blog-card p { flex: 1; font-size: 12px; line-height: 1.9; color: #666; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card h3 + .foot { margin-top: auto; padding-top: 14px; }

.blog-card .foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.blog-card .go { color: var(--ink); transition: transform 0.15s; }
.blog-card:hover .go { transform: translateX(4px); }

/* Carte à la une */
.blog-card.first { grid-column: 1 / -1; flex-direction: row; min-height: 340px; }
.blog-card.first .thumb { flex: 0 0 58%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--line); }
.blog-card.first .b { justify-content: center; padding: 36px 40px 30px; }
.blog-card.first h3 { font-size: 28px; line-height: 1.3; margin-bottom: 14px; }
.blog-card.first p { flex: 0 0 auto; font-size: 13px; -webkit-line-clamp: 5; line-clamp: 5; }
.blog-card.first .foot { margin-top: 10px; }
.blog-card.first:not(:has(.thumb)) { flex-direction: column; min-height: 0; }
.blog-card.first:not(:has(.thumb)) h3 { font-size: 26px; }

/* Étiquettes de catégorie (une couleur par catégorie) */
.tag {
  display: inline-block;
  padding: 0 9px;
  font-size: 9px;
  line-height: 1.9;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
}

.tag[data-tag="mise-a-jour"], .tag[data-tag="mises-a-jour"], .tag[data-tag="update"] { background: #1bd96a; color: #08210f; }
.tag[data-tag="annonce"] { background: #f16436; }
.tag[data-tag="coulisses"], .tag[data-tag="dev"], .tag[data-tag="devlog"] { background: #5b6cf0; }
.tag[data-tag="evenement"], .tag[data-tag="lune-de-sang"] { background: #b3202a; }

.blog-empty { margin: 8px 0 0; color: var(--muted); }
.blog-empty[hidden], .blog-more [hidden] { display: none; }

.blog-more { margin-top: 36px; text-align: center; }

.blog-more button {
  font: inherit;
  font-size: 12px;
  padding: 12px 28px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--ink);
  border-bottom-width: 4px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, color 0.15s;
}

.blog-more button:hover { background: var(--ink); color: #fff; transform: translateY(-2px); }

/* ── Article ───────────────────────────────────────────────────────── */

.post { max-width: 860px; margin: 0 auto; padding: 48px 36px 96px; }

.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: -12px 0 32px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.post-meta span:not(.tag) + span::before { content: "·"; margin-right: 14px; }

.post-cover { width: 100%; height: auto; display: block; margin: 0 0 36px; border: 1px solid var(--line); }

.post-shot { width: 100%; height: auto; display: block; margin: 28px 0; border: 1px solid var(--line); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }

.post-nav a {
  display: block;
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.post-nav a:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: 6px 6px 0 var(--ink); }
.post-nav a span { display: block; margin-bottom: 4px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.post-nav .next { grid-column: 2; text-align: right; }
.post-nav .prev:only-child { grid-column: 1; }

.post-others { margin-top: 72px; padding-top: 36px; border-top: 1px solid var(--line); }
.post-others .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1000px) {
  .blog-grid, .post-others .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-card.first .thumb { flex-basis: 50%; }
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .h-hero { min-height: 0; padding: 150px 20px 110px; }
  .h-dots { bottom: 32px; }
  .h-hero h1 { font-size: 38px; }
  .h-tagline { font-size: 16px; }
  .h-btn { width: 100%; min-width: 0; }
  .h-blog { padding: 56px 20px 72px; }
  .h-blog h2 { font-size: 28px; }
  .blog-grid, .post-others .blog-grid { grid-template-columns: 1fr; }
  .blog-card.first { flex-direction: column; min-height: 0; }
  .blog-card.first .thumb { flex-basis: auto; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--line); }
  .blog-card.first .b { padding: 22px 22px 18px; }
  .blog-card.first h3 { font-size: 21px; }
  .post { padding: 32px 20px 64px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; text-align: left; }
}

@media (max-width: 760px) {
  .h-logo { width: 150px; }
  .h-buttons { gap: 14px; }
  .h-btn { padding: 16px 20px; font-size: 15px; }
  .h-meta { margin-top: 24px; }
  .h-meta span { padding: 1px 10px; font-size: 9px; }
  .blog-head { margin-bottom: 24px; }
  .blog-filters { gap: 6px; }
  .blog-filters button { padding: 6px 12px; }
  .blog-grid { gap: 18px; }
  .blog-card:hover { transform: none; box-shadow: none; }
  .blog-card:hover .thumb img { transform: none; }
  .blog-card .b { padding: 16px 18px 14px; }
  .blog-card h3 { font-size: 17px; }
  .blog-more button { width: 100%; }
  .post-meta { margin: -8px 0 24px; gap: 10px; }
  .post-cover { margin-bottom: 24px; }
  .post-nav { margin-top: 40px; }
  .post-nav a:hover { transform: none; box-shadow: none; }
  .post-others { margin-top: 48px; padding-top: 28px; }
}

@media (max-width: 420px) {
  .h-hero { padding: 130px 16px 100px; }
  .h-hero h1 { font-size: 32px; }
  .h-tagline { font-size: 15px; margin-bottom: 28px; }
  .h-blog { padding: 48px 16px 64px; }
  .h-blog h2 { font-size: 24px; }
  .post { padding: 24px 16px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .h-slide.on, .h-logo, .h-hero-inner > * { animation: none; }
  .h-sparks { display: none; }
  .h-slide { transition: none; }
}
